aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpulib
diff options
context:
space:
mode:
authornotaz2012-07-18 23:41:31 +0300
committernotaz2012-07-19 00:20:13 +0300
commitaafcb4ddc257478d613611adcae7cb13fd716577 (patch)
treeb9fe3ea3a7544e8497fcc7c8e3fd60e152f5fcb9 /plugins/gpulib
parentc8eaa363acbafb84840b8d29b532ae1225d6d61c (diff)
downloadpcsx_rearmed-aafcb4ddc257478d613611adcae7cb13fd716577.tar.gz
pcsx_rearmed-aafcb4ddc257478d613611adcae7cb13fd716577.tar.bz2
pcsx_rearmed-aafcb4ddc257478d613611adcae7cb13fd716577.zip
gpulib: clear fb when display is blanked
Diffstat (limited to 'plugins/gpulib')
-rw-r--r--plugins/gpulib/gpu.c12
-rw-r--r--plugins/gpulib/gpu.h2
-rw-r--r--plugins/gpulib/vout_pl.c16
-rw-r--r--plugins/gpulib/vout_sdl.c4
4 files changed, 32 insertions, 2 deletions
diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c
index 79a5fa4..70847ab 100644
--- a/plugins/gpulib/gpu.c
+++ b/plugins/gpulib/gpu.c
@@ -601,7 +601,16 @@ void GPUupdateLace(void)
flush_cmd_buffer();
renderer_flush_queues();
- if (gpu.status.blanking || !gpu.state.fb_dirty)
+ if (gpu.status.blanking) {
+ if (!gpu.state.blanked) {
+ vout_blank();
+ gpu.state.blanked = 1;
+ gpu.state.fb_dirty = 1;
+ }
+ return;
+ }
+
+ if (!gpu.state.fb_dirty)
return;
if (gpu.frameskip.set) {
@@ -615,6 +624,7 @@ void GPUupdateLace(void)
vout_update();
gpu.state.fb_dirty = 0;
+ gpu.state.blanked = 0;
}
void GPUvBlank(int is_vblank, int lcf)
diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h
index 11bfe46..a508cdc 100644
--- a/plugins/gpulib/gpu.h
+++ b/plugins/gpulib/gpu.h
@@ -66,6 +66,7 @@ struct psx_gpu {
uint32_t fb_dirty:1;
uint32_t old_interlace:1;
uint32_t allow_interlace:2;
+ uint32_t blanked:1;
uint32_t *frame_count;
uint32_t *hcnt; /* hsync count */
struct {
@@ -105,6 +106,7 @@ void renderer_set_config(const struct rearmed_cbs *config);
int vout_init(void);
int vout_finish(void);
void vout_update(void);
+void vout_blank(void);
void vout_set_config(const struct rearmed_cbs *config);
/* listing these here for correct linkage if rasterizer uses c++ */
diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c
index 79b6c3e..0bd1ecf 100644
--- a/plugins/gpulib/vout_pl.c
+++ b/plugins/gpulib/vout_pl.c
@@ -9,6 +9,7 @@
* See the COPYING file in the top-level directory.
*/
+#include <string.h>
#include "gpu.h"
#include "cspace.h"
#include "../../frontend/plugin_lib.h"
@@ -52,8 +53,11 @@ static void blit(void)
int fb_offs, doffs;
uint8_t *dest;
- fb_offs = y * 1024 + x;
dest = (uint8_t *)screen_buf;
+ if (dest == NULL)
+ return;
+
+ fb_offs = y * 1024 + x;
// only do centering, at least for now
doffs = (stride - w) / 2 & ~1;
@@ -99,6 +103,16 @@ void vout_update(void)
blit();
}
+void vout_blank(void)
+{
+ check_mode_change();
+ if (cbs->pl_vout_raw_flip == NULL) {
+ int bytespp = gpu.status.rgb24 ? 3 : 2;
+ memset(screen_buf, 0, gpu.screen.hres * gpu.screen.h * bytespp);
+ screen_buf = cbs->pl_vout_flip();
+ }
+}
+
long GPUopen(void **unused)
{
gpu.frameskip.active = 0;
diff --git a/plugins/gpulib/vout_sdl.c b/plugins/gpulib/vout_sdl.c
index db1ae96..b8c4eae 100644
--- a/plugins/gpulib/vout_sdl.c
+++ b/plugins/gpulib/vout_sdl.c
@@ -77,6 +77,10 @@ void vout_update(void)
SDL_UpdateRect(screen, 0, 0, 1024, 512);
}
+void vout_blank(void)
+{
+}
+
long GPUopen(void **dpy)
{
*dpy = x11_display;