summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Farnsworth <simon.farnsworth@onelan.co.uk>2011-01-17 17:38:23 +0000
committerOwain G. Ainsworth <oga@openbsd.org>2011-03-16 20:08:04 +0000
commit5cd0e34ca161e4831d909fc5cac98462958214b4 (patch)
treee48394b1a95de5d85cd693f6e7084a0429ac143a
parentcc3f2154b5c99c91b229237c018e4b9ed7476e0f (diff)
Fix textured video when destination is larger than screen
In our application, the screen is never rotated from the point of view of the driver; instead, the compositor applies a suitable rotation as it composites the display. This works fine on 945, but on 965, videos are limited in height to the actual height of the screen. Change various bits of code so that we use the width and height of the destination pixmap instead of the width and height of the virtual screen. This works correctly both for XVideo to offscreen storage (CompositeRedirect) and for XVideo to the screen (no compositor). (cherry picked from commit 3a2a4b0784f0fc96a5457b18931471f15ad745fc) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/i965_video.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/i965_video.c b/src/i965_video.c
index 5609e197..8b18128b 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -415,8 +415,8 @@ static void i965_create_dst_surface_state(ScrnInfoPtr scrn,
intel_emit_reloc(surf_bo, offset + offsetof(struct brw_surface_state, ss1),
pixmap_bo, 0, I915_GEM_DOMAIN_SAMPLER, 0);
- dest_surf_state->ss2.height = scrn->virtualY - 1;
- dest_surf_state->ss2.width = scrn->virtualX - 1;
+ dest_surf_state->ss2.height = pixmap->drawable.height - 1;
+ dest_surf_state->ss2.width = pixmap->drawable.width - 1;
dest_surf_state->ss2.mip_count = 0;
dest_surf_state->ss2.render_target_rotation = 0;
dest_surf_state->ss3.pitch = intel_pixmap_pitch(pixmap) - 1;
@@ -771,7 +771,7 @@ static drm_intel_bo *i965_create_cc_state(ScrnInfoPtr scrn)
}
static void
-i965_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo * surface_state_binding_table_bo, int n_src_surf)
+i965_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo * surface_state_binding_table_bo, int n_src_surf, PixmapPtr pixmap)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
int urb_vs_start, urb_vs_size;
@@ -878,7 +878,7 @@ i965_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo * surface_state_binding_tab
*/
OUT_BATCH(BRW_3DSTATE_DRAWING_RECTANGLE | 2); /* XXX 3 for BLC or CTG */
OUT_BATCH(0x00000000); /* ymin, xmin */
- OUT_BATCH((scrn->virtualX - 1) | (scrn->virtualY - 1) << 16); /* ymax, xmax */
+ OUT_BATCH((pixmap->drawable.width - 1) | (pixmap->drawable.height - 1) << 16); /* ymax, xmax */
OUT_BATCH(0x00000000); /* yorigin, xorigin */
/* skip the depth buffer */
@@ -1213,7 +1213,7 @@ I965DisplayVideoTextured(ScrnInfoPtr scrn,
intel_batch_start_atomic(scrn, 100);
- i965_emit_video_setup(scrn, surface_state_binding_table_bo, n_src_surf);
+ i965_emit_video_setup(scrn, surface_state_binding_table_bo, n_src_surf, pixmap);
/* Set up the pointer to our vertex buffer */
OUT_BATCH(BRW_3DSTATE_VERTEX_BUFFERS | 3);
@@ -1518,13 +1518,13 @@ gen6_upload_depth_buffer_state(ScrnInfoPtr scrn)
}
static void
-gen6_upload_drawing_rectangle(ScrnInfoPtr scrn)
+gen6_upload_drawing_rectangle(ScrnInfoPtr scrn, PixmapPtr pixmap)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
OUT_BATCH(BRW_3DSTATE_DRAWING_RECTANGLE | 2);
OUT_BATCH(0x00000000); /* ymin, xmin */
- OUT_BATCH((scrn->virtualX - 1) | (scrn->virtualY - 1) << 16); /* ymax, xmax */
+ OUT_BATCH((pixmap->drawable.width - 1) | (pixmap->drawable.height - 1) << 16); /* ymax, xmax */
OUT_BATCH(0x00000000); /* yorigin, xorigin */
}
@@ -1674,7 +1674,7 @@ gen6_upload_vertex_element_state(ScrnInfoPtr scrn)
}
static void
-gen6_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo *surface_state_binding_table_bo, int n_src_surf)
+gen6_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo *surface_state_binding_table_bo, int n_src_surf, PixmapPtr pixmap)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
@@ -1695,7 +1695,7 @@ gen6_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo *surface_state_binding_tabl
gen6_upload_wm_state(scrn, n_src_surf == 1 ? TRUE : FALSE);
gen6_upload_binding_table(scrn, (n_src_surf + 1) * ALIGN(sizeof(struct brw_surface_state), 32));;
gen6_upload_depth_buffer_state(scrn);
- gen6_upload_drawing_rectangle(scrn);
+ gen6_upload_drawing_rectangle(scrn, pixmap);
gen6_upload_vertex_element_state(scrn);
}
@@ -1854,7 +1854,7 @@ void Gen6DisplayVideoTextured(ScrnInfoPtr scrn,
intel_batch_submit(scrn, FALSE);
intel_batch_start_atomic(scrn, 200);
- gen6_emit_video_setup(scrn, surface_state_binding_table_bo, n_src_surf);
+ gen6_emit_video_setup(scrn, surface_state_binding_table_bo, n_src_surf, pixmap);
/* Set up the pointer to our vertex buffer */
OUT_BATCH(BRW_3DSTATE_VERTEX_BUFFERS | (5 - 2));