From patchwork Thu Jul 14 21:21:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Graunke X-Patchwork-Id: 975952 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6ELTJd6005961 for ; Thu, 14 Jul 2011 21:29:39 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6BE19EFD5 for ; Thu, 14 Jul 2011 14:29:19 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from homiemail-a5.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F0799F017 for ; Thu, 14 Jul 2011 14:24:58 -0700 (PDT) Received: from homiemail-a5.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a5.g.dreamhost.com (Postfix) with ESMTP id 0F4C670407C; Thu, 14 Jul 2011 14:24:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=whitecape.org; h=from:to:cc :subject:date:message-id:in-reply-to:references; q=dns; s= whitecape.org; b=cquFHF9CReD1k+tiK8jr2e3ZbaVCQ59eNOXtWL9Ewky14ns PA4VkFUqtFgcskY+HTVe0F9n+OwNnJeoLm9v7pXDZHTz7Ehl7h9Phtr4GCZuCVRR EUuoml9Avhpf6+QyHODSugbjx0jyJe3xJ/hww6O3nxbOzk9/2L2NuvvIJphg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=whitecape.org; h=from:to :cc:subject:date:message-id:in-reply-to:references; s= whitecape.org; bh=lUoLao2KDI00uNY/ixL3DMYoHRY=; b=VdeIW5wfFM7udd G4V3aDh+Ry8N/gwFewPvtjLzDqWb2EWsyJ2zxWMazS5uXgMggdjcQL+Agg4iRzAG RwVX5DrAc3fE3eFKcl0D3XNMJRJETNY+OxO8cAKgL6Js9rvPtjStDQOD/XcUw5me 83YmYs5qsCwsMPUrv1isROb+LWVh8= Received: from localhost (fruit.freedesktop.org [131.252.210.190]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: kenneth@whitecape.org) by homiemail-a5.g.dreamhost.com (Postfix) with ESMTPSA id DB932704078; Thu, 14 Jul 2011 14:24:56 -0700 (PDT) From: Kenneth Graunke To: intel-gfx@lists.freedesktop.org Date: Thu, 14 Jul 2011 14:21:22 -0700 Message-Id: <1310678483-7494-10-git-send-email-kenneth@whitecape.org> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1310678483-7494-1-git-send-email-kenneth@whitecape.org> References: <1310678483-7494-1-git-send-email-kenneth@whitecape.org> Subject: [Intel-gfx] [PATCH 09/10] render: Update pixel shader state for Ivybridge. 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 21:29:39 +0000 (UTC) Signed-off-by: Kenneth Graunke --- src/i965_render.c | 38 +++++++++++++++++++++++++++++++++++--- 1 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/i965_render.c b/src/i965_render.c index 5222d1c..596d070 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -2657,6 +2657,37 @@ gen6_composite_wm_state(intel_screen_private *intel, } static void +gen7_composite_wm_state(intel_screen_private *intel, + Bool has_mask, + drm_intel_bo *bo) +{ + int num_surfaces = has_mask ? 3 : 2; + + if (intel->gen6_render_state.kernel == bo) + return; + + intel->gen6_render_state.kernel = bo; + + OUT_BATCH(GEN6_3DSTATE_WM | (3 - 2)); + OUT_BATCH(GEN7_WM_DISPATCH_ENABLE | + GEN7_WM_PERSPECTIVE_PIXEL_BARYCENTRIC); + OUT_BATCH(0); + + OUT_BATCH(GEN7_3DSTATE_PS | (8 - 2)); + OUT_RELOC(bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_BATCH((1 << GEN7_PS_SAMPLER_COUNT_SHIFT) | + (num_surfaces << GEN7_PS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH(((86 - 1) << GEN7_PS_MAX_THREADS_SHIFT) | + GEN7_PS_ATTRIBUTE_ENABLE | + GEN7_PS_16_DISPATCH_ENABLE); + OUT_BATCH((6 << GEN7_PS_DISPATCH_START_GRF_SHIFT_0)); + OUT_BATCH(0); /* kernel 1 pointer */ + OUT_BATCH(0); /* kernel 2 pointer */ +} + + +static void gen6_composite_drawing_rectangle(intel_screen_private *intel, PixmapPtr dest) { @@ -2809,12 +2840,13 @@ gen6_emit_composite_state(struct intel_screen_private *intel) (src * BRW_BLENDFACTOR_COUNT + dst) * GEN6_BLEND_STATE_PADDED_SIZE); gen6_composite_sampler_state_pointers(intel, ps_sampler_state_bo); gen6_composite_sf_state(intel, has_mask); - gen6_composite_wm_state(intel, - has_mask, - render->wm_kernel_bo[composite_op->wm_kernel]); if (ivb) { + gen7_composite_wm_state(intel, has_mask, + render->wm_kernel_bo[composite_op->wm_kernel]); gen7_upload_binding_table(intel, intel->surface_table); } else { + gen6_composite_wm_state(intel, has_mask, + render->wm_kernel_bo[composite_op->wm_kernel]); gen6_upload_binding_table(intel, intel->surface_table); } gen6_composite_drawing_rectangle(intel, intel->render_dest);