From patchwork Wed Oct 24 16:33:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 1639561 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 B32943FCF7 for ; Wed, 24 Oct 2012 16:34:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABD77A08E3 for ; Wed, 24 Oct 2012 09:34:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id B0031A08E6 for ; Wed, 24 Oct 2012 09:33:36 -0700 (PDT) Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0C230A2FD6; Wed, 24 Oct 2012 18:33:36 +0200 (CEST) Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id 7D7A63F1DF; Wed, 24 Oct 2012 18:33:35 +0200 (CEST) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH] DRM/Radeon: Set depth on low mem Radeon cards to 16 instead of 8. Date: Wed, 24 Oct 2012 18:33:22 +0200 Message-Id: <1351096402-5802-1-git-send-email-eich@suse.de> X-Mailer: git-send-email 1.7.6.3 Cc: Egbert Eich 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 The Radeon driver reduces the framebuffer resolution to 8bpp if a device with less than 32 Mb VRAM is found. This causes the framebuffer to run in 8 bit paletted mode. For a text console this is not an issue as 256 different colors is more than one gets on a VGA text console. It is done to give X more memory to work with since the console memory is not freed but remains allocated while X is active. Still, running the fbdev Xserver driver - which we do during installation - will give applications an 8bit pseudo-color visual which doesn't look too pretty. We therefore limit the framebuffer bpp to 16 when memory is 24MB or lower and to 8 only if 8MB or less VRAM is found. This should be a reasonable compromise for us. This patch will most likely not ever make it upstream. This works around ugly modes on crappy IPMI cards using ES1000. Signed-off-by: Egbert Eich --- drivers/gpu/drm/radeon/radeon_fb.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index cc8489d..9e8e221 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -356,9 +356,12 @@ int radeon_fbdev_init(struct radeon_device *rdev) int bpp_sel = 32; int ret; - /* select 8 bpp console on RN50 or 16MB cards */ - if (ASIC_IS_RN50(rdev) || rdev->mc.real_vram_size <= (32*1024*1024)) + /* select 16 bpp console on RN50 or 32MB cards */ + if (rdev->mc.real_vram_size <= (8*1024*1024)) bpp_sel = 8; + else if (ASIC_IS_RN50(rdev) + || rdev->mc.real_vram_size <= (32*1024*1024)) + bpp_sel = 16; rfbdev = kzalloc(sizeof(struct radeon_fbdev), GFP_KERNEL); if (!rfbdev)