From: Ilija Hadzic Subject: [PATCH 2/2] drm/radeon/kms/blit: workaround for a possible hardware bug Date: Wed, 1 Feb 2012 11:42:39 -0500 Message-ID: <1328114559-22609-2-git-send-email-ihadzic@research.bell-labs.com> References: <1328114559-22609-1-git-send-email-ihadzic@research.bell-labs.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from ihemail3.lucent.com (ihemail3.lucent.com [135.245.0.37]) by gabe.freedesktop.org (Postfix) with ESMTP id A491C9EB0F for ; Wed, 1 Feb 2012 08:42:56 -0800 (PST) In-Reply-To: <1328114559-22609-1-git-send-email-ihadzic@research.bell-labs.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: airlied@gmail.com, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org If a blit copy operation specifies a rectangle whose one dimension is 16384 (max allowed by these chips), the chip will silently drop all commands. Fixed by reducing the maximum dimension by one rectangle unit size. In the mainline kernel, the problem is exposed only when buffers are very large (1G), but it's still a problem. The problem *could* be exposed for smaller buffers if anyone modifies the algorithm for rectangle construction in r600_blit_create_rect() (the reason why someone would modify that algorithm is to tune the performance of buffer moves). Signed-off-by: Ilija Hadzic --- drivers/gpu/drm/radeon/evergreen_blit_kms.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index 4e83fdc..24abdf4 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c @@ -631,7 +631,8 @@ int evergreen_blit_init(struct radeon_device *rdev) if (rdev->family >= CHIP_CAYMAN) rdev->r600_blit.ring_size_per_loop += 9; /* additional DWs for surface sync */ - rdev->r600_blit.max_dim = 16384; + /* Evergreen/NI bug: max dimension 16384 is broken for blit copy */ + rdev->r600_blit.max_dim = 16384 - RECT_UNIT_H; /* pin copy shader into vram if already initialized */ if (rdev->r600_blit.shader_obj) -- 1.7.7