From patchwork Mon Jan 17 17:38:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Farnsworth X-Patchwork-Id: 484231 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0HIHMgd007405 for ; Mon, 17 Jan 2011 18:17:43 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15D669E964 for ; Mon, 17 Jan 2011 10:17:22 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 17 Jan 2011 18:17:43 +0000 (UTC) X-Greylist: delayed 2304 seconds by postgrey-1.31 at gabe; Mon, 17 Jan 2011 10:16:58 PST Received: from claranet-outbound-smtp06.uk.clara.net (claranet-outbound-smtp06.uk.clara.net [195.8.89.39]) by gabe.freedesktop.org (Postfix) with ESMTP id 147389E81E for ; Mon, 17 Jan 2011 10:16:58 -0800 (PST) Received: from 110.100.155.90.in-addr.arpa ([90.155.100.110]:45376 helo=localhost.localdomain) by relay06.mail.eu.clara.net (relay.clara.net [213.253.3.46]:1025) with esmtpa (authdaemon_plain:simon.farnsworth@onelan.co.uk) id 1Pet2H-0003vO-Jg (return-path ); Mon, 17 Jan 2011 17:38:33 +0000 From: Simon Farnsworth To: intel-gfx@lists.freedesktop.org Date: Mon, 17 Jan 2011 17:38:23 +0000 Message-Id: <1295285903-5681-1-git-send-email-simon.farnsworth@onelan.co.uk> X-Mailer: git-send-email 1.7.0.1 Subject: [Intel-gfx] [PATCH] Fix textured video when destination is larger than screen X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org diff --git a/src/i965_video.c b/src/i965_video.c index 235dfb9..a7374a2 100644 --- a/src/i965_video.c +++ b/src/i965_video.c @@ -414,8 +414,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; @@ -770,7 +770,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; @@ -877,7 +877,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 */ @@ -1212,7 +1212,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); @@ -1517,13 +1517,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 */ } @@ -1673,7 +1673,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); @@ -1694,7 +1694,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); } @@ -1853,7 +1853,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));