From patchwork Wed Jul 25 03:09:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 1234251 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 7C5EDDF24C for ; Wed, 25 Jul 2012 03:26:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 546DC9EB0D for ; Tue, 24 Jul 2012 20:26:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by gabe.freedesktop.org (Postfix) with ESMTP id 7301D9E7C2 for ; Tue, 24 Jul 2012 20:22:42 -0700 (PDT) Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id q6P396ri022504 for ; Tue, 24 Jul 2012 22:09:07 -0500 Message-ID: <1343185746.3715.38.camel@pasglop> Subject: [PATCH 6/6] drm/cirrus: Retrieve default mode from the device-tree if any From: Benjamin Herrenschmidt To: dri-devel@lists.freedesktop.org Date: Wed, 25 Jul 2012 13:09:06 +1000 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 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: , 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 On the pseries machine type, qemu puts a default mode in the device-tree based on the user request (-g option) which the firmware uses to setup the boot screen. Currently cirrusdrmfb ignores this and always ends up using 1280x1024. This adds support for retrieving this information and using it to set the default mode and depth. Signed-off-by: Benjamin Herrenschmidt --- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 3 +-- drivers/gpu/drm/cirrus/cirrus_mode.c | 37 +++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index 1345215..b0e4080 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -296,9 +296,8 @@ 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); if (!gfbdev) return -ENOMEM; diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 1566853..1ba73b0 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -19,6 +19,8 @@ #include "drm_crtc_helper.h" #include