From: alexdeucher@gmail.com Subject: [PATCH] radeon: fall back to 1D tiling only with broken kernels Date: Wed, 6 Jun 2012 09:25:24 -0400 Message-ID: <1338989124-484-1-git-send-email-alexdeucher@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 0523F9F4D4 for ; Wed, 6 Jun 2012 06:25:31 -0700 (PDT) Received: by vbbfo1 with SMTP id fo1so4235344vbb.36 for ; Wed, 06 Jun 2012 06:25:31 -0700 (PDT) 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: dri-devel@lists.freedesktop.org Cc: Alex Deucher List-Id: dri-devel@lists.freedesktop.org From: Alex Deucher Certain cards report the the wrong bank setup which causes surface init to fail in the ddx and leads to no accel. If we hit an invalid tiling parameter, just set a default value and disable 2D tiling. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=43448 Signed-off-by: Alex Deucher --- radeon/radeon_surface.c | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c index a7b488b..adf209d 100644 --- a/radeon/radeon_surface.c +++ b/radeon/radeon_surface.c @@ -206,7 +206,9 @@ static int r6_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.num_pipes = 8; break; default: - return -EINVAL; + surf_man->hw_info.num_pipes = 8; + surf_man->hw_info.allow_2d = 0; + break; } switch ((tiling_config & 0x30) >> 4) { @@ -217,7 +219,9 @@ static int r6_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.num_banks = 8; break; default: - return -EINVAL; + surf_man->hw_info.num_banks = 8; + surf_man->hw_info.allow_2d = 0; + break; } switch ((tiling_config & 0xc0) >> 6) { @@ -228,7 +232,9 @@ static int r6_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.group_bytes = 512; break; default: - return -EINVAL; + surf_man->hw_info.group_bytes = 256; + surf_man->hw_info.allow_2d = 0; + break; } return 0; } @@ -458,7 +464,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.num_pipes = 8; break; default: - return -EINVAL; + surf_man->hw_info.num_pipes = 8; + surf_man->hw_info.allow_2d = 0; + break; } switch ((tiling_config & 0xf0) >> 4) { @@ -472,7 +480,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.num_banks = 16; break; default: - return -EINVAL; + surf_man->hw_info.num_banks = 8; + surf_man->hw_info.allow_2d = 0; + break; } switch ((tiling_config & 0xf00) >> 8) { @@ -483,7 +493,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.group_bytes = 512; break; default: - return -EINVAL; + surf_man->hw_info.group_bytes = 256; + surf_man->hw_info.allow_2d = 0; + break; } switch ((tiling_config & 0xf000) >> 12) { @@ -497,7 +509,9 @@ static int eg_init_hw_info(struct radeon_surface_manager *surf_man) surf_man->hw_info.row_size = 4096; break; default: - return -EINVAL; + surf_man->hw_info.row_size = 4096; + surf_man->hw_info.allow_2d = 0; + break; } return 0; } -- 1.7.7.5