From patchwork Fri Jan 25 16:21:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 2046141 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 42DFB3FD1A for ; Fri, 25 Jan 2013 16:24:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17B08E690B for ; Fri, 25 Jan 2013 08:24:50 -0800 (PST) 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 AC1DAE6396 for ; Fri, 25 Jan 2013 08:21:56 -0800 (PST) Received: from relay1.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 0F44EA39D2; Fri, 25 Jan 2013 17:21:56 +0100 (CET) From: Takashi Iwai To: David Airlie Subject: [PATCH 2/2] drm/cirrus: Use 16bpp as default Date: Fri, 25 Jan 2013 17:21:55 +0100 Message-Id: <1359130915-30082-2-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1359130915-30082-1-git-send-email-tiwai@suse.de> References: <1359130915-30082-1-git-send-email-tiwai@suse.de> Cc: dri-devel@lists.freedesktop.org, Bernhard Wiedemann , linux-kernel@vger.kernel.org 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 We've got a bug report that GNOME on QEMU shows wrong colors. It turned out that it's because Cairo doesn't support 24bpp well. This hasn't been an issue until now because we (at least SUSE and Fedora) have a patch to use 16bpp for QEMU in Xorg cirrus UMS driver. Since cirrus KMS driver is mainly targeted for the use on QEMU/KVM, we should choose 16bpp as default, too. Also, it's not convenient to set the default bpp in multiple places. cirrus_fbdev_init() should check the original preferred depth set in cirrus_modeset_init(). Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=799216 Signed-off-by: Takashi Iwai --- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 +- drivers/gpu/drm/cirrus/cirrus_mode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index 6c6b4c8..bc081ea 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -273,7 +273,7 @@ int cirrus_fbdev_init(struct cirrus_device *cdev) { struct cirrus_fbdev *gfbdev; int ret; - int bpp_sel = 24; + int bpp_sel = cdev->dev->mode_config.preferred_depth; /*bpp_sel = 8;*/ gfbdev = kzalloc(sizeof(struct cirrus_fbdev), GFP_KERNEL); diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 379a47e..e259f07 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -588,7 +588,7 @@ int cirrus_modeset_init(struct cirrus_device *cdev) cdev->dev->mode_config.max_height = CIRRUS_MAX_FB_HEIGHT; cdev->dev->mode_config.fb_base = cdev->mc.vram_base; - cdev->dev->mode_config.preferred_depth = 24; + cdev->dev->mode_config.preferred_depth = 16; /* don't prefer a shadow on virt GPU */ cdev->dev->mode_config.prefer_shadow = 0;