From patchwork Mon Jul 16 21:14:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 1202061 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 695223FC33 for ; Mon, 16 Jul 2012 21:14:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DFA5A0233 for ; Mon, 16 Jul 2012 14:14:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gh0-f177.google.com (mail-gh0-f177.google.com [209.85.160.177]) by gabe.freedesktop.org (Postfix) with ESMTP id DE3829E8CF for ; Mon, 16 Jul 2012 14:14:17 -0700 (PDT) Received: by ghbf11 with SMTP id f11so5965592ghb.36 for ; Mon, 16 Jul 2012 14:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=XAUup0eM6E/Nk+IdiNwpL/vSF/t5+qe+k5OjOO8cvw8=; b=qSjK0+oxj2mfqycJQqKNiTw42UfegM+cAO3cYMXGKJBcTjKszvbPk58qroaaXOgmHk tBN7UN0Mx3NpBgB8RtDdYDzfGIxw4kIsSl4LPvUxfNzx1ZaueeEyNCjcVzNv5/PH3o2/ dQ/06OuSX7tweVp0REIFfOObzAgwxh8D9bSMOspTmb2n8EQW+t7kLaAIeRR73hvkr5hy /er0vtBK5yKqTRLbX2Z2sm1/BxwofOtRuJ3uM0aRTcf6QMn4V2IH6viLi/0wttYsxXJs NX1vanniEiWeTYO7yA63uF2ncW/dTNexkKPTZpHlvrICIZ45iMyUaVgcOQ/XgQc1d/36 bwag== Received: by 10.236.181.9 with SMTP id k9mr10563976yhm.58.1342473257268; Mon, 16 Jul 2012 14:14:17 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPS id e19sm15282707ann.10.2012.07.16.14.14.15 (version=SSLv3 cipher=OTHER); Mon, 16 Jul 2012 14:14:16 -0700 (PDT) From: alexdeucher@gmail.com To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: update ib_execute for SI Date: Mon, 16 Jul 2012 17:14:06 -0400 Message-Id: <1342473246-3148-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1342188495-3705-3-git-send-email-deathsimple@vodafone.de> References: <1342188495-3705-3-git-send-email-deathsimple@vodafone.de> Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Alex Deucher When submitting a CONST_IB, emit a SWITCH_BUFFER packet before the CONST_IB. This isn't strictly necessary (the driver will work fine without it), but is good practice and allows for more flexible DE/CE sychronization options in the future. Current userspace drivers do not take advantage of the CE yet. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/si.c | 6 ++++++ drivers/gpu/drm/radeon/sid.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 53e313b..191a3cd 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -1778,6 +1778,12 @@ void si_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) else header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); + if (ib->is_const_ib) { + /* set switch buffer packet before const IB */ + radeon_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0)); + radeon_ring_write(ring, 0); + } + radeon_ring_write(ring, header); radeon_ring_write(ring, #ifdef __BIG_ENDIAN diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h index db40679..7869089 100644 --- a/drivers/gpu/drm/radeon/sid.h +++ b/drivers/gpu/drm/radeon/sid.h @@ -901,5 +901,6 @@ #define PACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 #define PACKET3_SET_CE_DE_COUNTERS 0x89 #define PACKET3_WAIT_ON_AVAIL_BUFFER 0x8A +#define PACKET3_SWITCH_BUFFER 0x8B #endif