From patchwork Fri Oct 17 14:28:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 5097961 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4D760C11AC for ; Fri, 17 Oct 2014 14:28:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DA80201CD for ; Fri, 17 Oct 2014 14:28:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 71AC820125 for ; Fri, 17 Oct 2014 14:28:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F04B46E296; Fri, 17 Oct 2014 07:28:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 915336E296 for ; Fri, 17 Oct 2014 07:28:28 -0700 (PDT) Received: by mail-wi0-f173.google.com with SMTP id fb4so2269609wid.0 for ; Fri, 17 Oct 2014 07:28:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jsQDO3sd/7vjE6c7yL5Q4pI0EyYQmrvlBq68ALZwLPI=; b=bNui+0KVjqmmZ3mk0Q/B6OK8YS+i9m4vrmZBeps4Hf55EwcRdcPkvYi8L+PEpw/7Lx e6FyfCumN73OEv0dgWpHcl+kRybqTB97uFhoBhbc881KZez6h2o6e7AA47ZCxIwhajMr furO7J7YTv1QcX38P33sY4lcjDp/gWa4nccYw+pGmrS0uNHqwTlq0dxl71PEl17+cZHU AKSx/nCi+6h0FolgcQdHsO5BINp2umzZ+qmVENbYud4pp6lUtyS7tl8gEGMCreB53E6T 3lwIbteNYXo7wnnt5g6dCrAaFKXs57rVCj1jNTe9TSPOBVK9wSgQWLXmWyT+5CrK9vSi /O2A== X-Gm-Message-State: ALoCoQlXNaGQE73pAlsOtmHJQcc8rY08Vix1saMmNz+Rr8eQGbKOlHr8Y7hIUtIQpBPTYAZvGnlv X-Received: by 10.180.104.7 with SMTP id ga7mr263269wib.1.1413556107338; Fri, 17 Oct 2014 07:28:27 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id q5sm1849937wja.49.2014.10.17.07.28.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Oct 2014 07:28:26 -0700 (PDT) From: Daniel Thompson To: David Airlie Subject: [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes. Date: Fri, 17 Oct 2014 15:28:08 +0100 Message-Id: <1413556088-30194-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently forcing the video mode from the kernel command line (for example video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits per pixel. This is due to a rather aggressive override in msm_fbdev_create(). This is a particular problem for Android bring up because the software EGL fallbacks don't support 32bpp. This problem could be trivially fixed by removing the override completely. However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to XR24 rather than AR24") this patch continues to override the depth if there are 32 bits per pixel. Change was tested by dd'ing a test image to /dev/fb0 with no video= (still 32bpp, DBG() message observed), video=1920x1080-32@60 (message observed), video=1920x1080-24@60 and video=1920x1080-16@60 . Signed-off-by: Daniel Thompson Cc: David Airlie Cc: Rob Clark --- drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 1.9.3 diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index ab5bfd2..ed0171d 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, uint32_t paddr; int ret, size; - sizes->surface_bpp = 32; - sizes->surface_depth = 24; + if (sizes->surface_bpp == 32) { + DBG("forcing surface depth to 24\n"); + sizes->surface_depth = 24; + } DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width, sizes->surface_height, sizes->surface_bpp,