summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-02-25 12:26:37 +0100
committerChristian König <[email protected]>2012-03-01 15:06:55 +0100
commitc14c84f383309ee0fdf007c0d3e968c38f3af86e (patch)
treefbf5050c11df315d3f4728307e273e0f91e6f42c /src/gallium/state_trackers
parent91ac681113b05f8fe4dff51c3b80f967ac05c867 (diff)
vl: move dirty area handling into winsys abstraction
Fixing uninitialized areas in SwapBuffers mode. Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c7
-rw-r--r--src/gallium/state_trackers/vdpau/vdpau_private.h1
-rw-r--r--src/gallium/state_trackers/xvmc/surface.c5
-rw-r--r--src/gallium/state_trackers/xvmc/xvmc_private.h3
4 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index e3ad03a2a51..37c5c695e4d 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -73,8 +73,6 @@ vlVdpPresentationQueueCreate(VdpDevice device,
goto no_compositor;
}
- vl_compositor_reset_dirty_area(&pq->dirty_area);
-
*presentation_queue = vlAddDataHTAB(pq);
if (*presentation_queue == 0) {
ret = VDP_STATUS_ERROR;
@@ -205,6 +203,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
struct pipe_resource *tex;
struct pipe_surface surf_templ, *surf_draw;
struct pipe_video_rect src_rect, dst_clip;
+ struct u_rect *dirty_area;
pq = vlGetDataHTAB(presentation_queue);
if (!pq)
@@ -216,6 +215,8 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
if (!tex)
return VDP_STATUS_INVALID_HANDLE;
+ dirty_area = vl_screen_get_dirty_area(pq->device->vscreen);
+
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = tex->format;
surf_templ.usage = PIPE_BIND_RENDER_TARGET;
@@ -239,7 +240,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
vl_compositor_clear_layers(&pq->compositor);
vl_compositor_set_rgba_layer(&pq->compositor, 0, surf->sampler_view, &src_rect, NULL);
- vl_compositor_render(&pq->compositor, surf_draw, NULL, &dst_clip, &pq->dirty_area);
+ vl_compositor_render(&pq->compositor, surf_draw, NULL, &dst_clip, dirty_area);
pipe->screen->flush_frontbuffer
(
diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h
index e02744ffd41..1645362444e 100644
--- a/src/gallium/state_trackers/vdpau/vdpau_private.h
+++ b/src/gallium/state_trackers/vdpau/vdpau_private.h
@@ -301,7 +301,6 @@ typedef struct
vlVdpDevice *device;
Drawable drawable;
struct vl_compositor compositor;
- struct u_rect dirty_area;
} vlVdpPresentationQueue;
typedef struct
diff --git a/src/gallium/state_trackers/xvmc/surface.c b/src/gallium/state_trackers/xvmc/surface.c
index 8fc96072344..c6f6ef593b4 100644
--- a/src/gallium/state_trackers/xvmc/surface.c
+++ b/src/gallium/state_trackers/xvmc/surface.c
@@ -359,6 +359,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
struct pipe_resource *tex;
struct pipe_surface surf_templ, *surf;
+ struct u_rect *dirty_area;
XVMC_MSG(XVMC_TRACE, "[XvMC] Displaying surface %p.\n", surface);
@@ -380,6 +381,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
compositor = &context_priv->compositor;
tex = vl_screen_texture_from_drawable(context_priv->vscreen, drawable);
+ dirty_area = vl_screen_get_dirty_area(context_priv->vscreen);
+
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = tex->format;
surf_templ.usage = PIPE_BIND_RENDER_TARGET;
@@ -427,7 +430,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
// Workaround for r600g, there seems to be a bug in the fence refcounting code
pipe->screen->fence_reference(pipe->screen, &surface_priv->fence, NULL);
- vl_compositor_render(compositor, surf, &dst_rect, NULL, &context_priv->dirty_area);
+ vl_compositor_render(compositor, surf, &dst_rect, NULL, dirty_area);
pipe->flush(pipe, &surface_priv->fence);
diff --git a/src/gallium/state_trackers/xvmc/xvmc_private.h b/src/gallium/state_trackers/xvmc/xvmc_private.h
index 8242be9aea8..4117f5bf689 100644
--- a/src/gallium/state_trackers/xvmc/xvmc_private.h
+++ b/src/gallium/state_trackers/xvmc/xvmc_private.h
@@ -35,7 +35,6 @@
#include "util/u_debug.h"
#include "util/u_math.h"
-#include "util/u_rect.h"
#include "vl/vl_csc.h"
#include "vl/vl_compositor.h"
@@ -62,8 +61,6 @@ typedef struct
unsigned short subpicture_max_width;
unsigned short subpicture_max_height;
- struct u_rect dirty_area;
-
} XvMCContextPrivate;
typedef struct