From patchwork Fri Mar 2 09:09:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 130493 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1049663lja; Fri, 2 Mar 2018 01:10:32 -0800 (PST) X-Google-Smtp-Source: AG47ELsitMTl0D9XiQClZTBUyqyTx4ZxbOxuamS0YyKor/4w0HdDTbjC/8uDR7spF1UJ25jkluCJ X-Received: by 10.99.60.72 with SMTP id i8mr2608561pgn.399.1519981831838; Fri, 02 Mar 2018 01:10:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519981831; cv=none; d=google.com; s=arc-20160816; b=Vl1rlzzmDY5P4Dfn4C7Yw4kSflXmMEMJ7MJ7hoslXP4IThwod4X+0QyNS2pRH9XHqE 9UwJVqyKhlkp+b97SN94zXJTOMfjdWGURqzm5JARpAAbfEDxheDER0qPi3+PPT7p1y8T ZnrXHmU02BcVxlveGNkzFLS1VEoxFAESkFy5og0sSGmyplfSsRKgq6x+0y+Zieqzb7qA gW4qXm59RWKLNpVN4kfEPu33Zl+cFj9KMsQd/pIwSN43sNJbX/mUYvVDdqSBcAqxNjSI t1mfMjEA99kqV/h1xiv2TyBfZbt2zKmPXRWAAQ9naKQKIQVfzshEAoT6hQCFnGcADJ8m vdaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=LqtGzmPQvOAj7KHtd8ig+4e0WlSFHC1KmxGilxP8m/s=; b=UJwT0sr8XeZ7gAqS4fkCStqKQ8lf/mnaas64E7lOib52UkQ/EB3oxfmBR7X1VYIoag KzG0HbkyikbcBgj/GgsRGt6POe/boZTlbwi59fJxWEq2XriZCU9gf+icps+TuDix+AZ/ lreqWuYbSs+T4FU0hWeo8S4UzF9xEyjaRJiIyamE2xgP6LOhq7iAVshqtyyLv7ATiWIl Rk/ed3fe9jexWCaO88eLI8x2L37hcGGh+qX8zGDBlkGf9nrRZJKcRExcxp8ixMDKEtj9 9Di1+HG/2lTAjyPDn/LrBaHs9GjMBRG8StRjYcNcDm+cvjhylYcSXmAxUPt4XXRq9SNe 3MrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hY3FeSSY; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id s17si3767815pgq.421.2018.03.02.01.10.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Mar 2018 01:10:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hY3FeSSY; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7AAAB6EE37; Fri, 2 Mar 2018 09:10:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id C7A066EE37 for ; Fri, 2 Mar 2018 09:09:57 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id y19so12360715lfd.4 for ; Fri, 02 Mar 2018 01:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bVvEDe8oPb7L+aZO6IjaSj07OZzlPiwxkPLUBBkIMso=; b=hY3FeSSYyvmCMY2FIKu+EL40aa5kJPtfipmQP0O2nEkAVvZSp/7CNGM9RqHVvI56oH ineOrINbxQDUKtBBqTFgbT16Ndr8ZnvmgTjTyhMBll03ZPXigdKb6BoB8IG8zUCT4Alj 1NaAbDheKFMJASuEaGY2X4NVg+r4pr9Ih+M7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bVvEDe8oPb7L+aZO6IjaSj07OZzlPiwxkPLUBBkIMso=; b=SA8Xn+QzmDEuWakgu74qrSuaXfgAQfiHUoDGI/o+tLcynS/z+saEM6LgRpT9NKTFOZ +KFPAGMd96QoV2Lee35xcFkYj2brwU9rJkNMLywOQzkiacoaG2/y+1w8oVyzuG07TOVx nOuj4CbUOyhzxljlPfqaJbHAS7C3+LvmlLurBebdfH9XLxxMONl65Zxa1PJiJ67fPWT1 mFXrPO18FBtl+tMtONkw9SNF8a+bX2TUr4P7VXGkMIUi2JSthyaz+DvwmJYoknWQEsJW gQ6jC5nja8CaM5Q+ZplrlWTarptrUe6CnZRys7LLUmZNgfAv5GmMFXYc6zckxt2BCaud CBeQ== X-Gm-Message-State: AElRT7E68QexGXNJCPdQw9fmxzxsjYj+ed191chG06reak6QGFkP2qVn scv/VY5UckbZJfeGp661v6ngzg== X-Received: by 10.25.142.72 with SMTP id q69mr3586786lfd.82.1519981796034; Fri, 02 Mar 2018 01:09:56 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id c63sm1242729lfg.82.2018.03.02.01.09.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Mar 2018 01:09:55 -0800 (PST) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt , Liviu Dudau Subject: [PATCH 1/4] drm/pl111: Make the default BPP a per-variant variable Date: Fri, 2 Mar 2018 10:09:45 +0100 Message-Id: <20180302090948.6399-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180302090948.6399-1-linus.walleij@linaro.org> References: <20180302090948.6399-1-linus.walleij@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The PL110, Integrator and Versatile boards strongly prefer to use 16 BPP even if other modes are supported, both to keep down memory consumption and also to easier find a good match to supported resolutions with consideration taken to the memory bandwidth of the platforms. Reviewed-by: Eric Anholt Signed-off-by: Linus Walleij --- drivers/gpu/drm/pl111/pl111_drm.h | 2 ++ drivers/gpu/drm/pl111/pl111_drv.c | 4 +++- drivers/gpu/drm/pl111/pl111_versatile.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h index 6d0e450e51b1..360fbdd2203c 100644 --- a/drivers/gpu/drm/pl111/pl111_drm.h +++ b/drivers/gpu/drm/pl111/pl111_drm.h @@ -43,6 +43,7 @@ struct drm_minor; * @broken_vblank: the vblank IRQ is broken on this variant * @formats: array of supported pixel formats on this variant * @nformats: the length of the array of supported pixel formats + * @fb_bpp: desired bits per pixel on the default framebuffer */ struct pl111_variant_data { const char *name; @@ -52,6 +53,7 @@ struct pl111_variant_data { bool broken_vblank; const u32 *formats; unsigned int nformats; + unsigned int fb_bpp; }; struct pl111_drm_dev_private { diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 1231905150d0..73d252351438 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -192,7 +192,7 @@ static int pl111_modeset_init(struct drm_device *dev) drm_mode_config_reset(dev); - drm_fb_cma_fbdev_init(dev, 32, 0); + drm_fb_cma_fbdev_init(dev, priv->variant->fb_bpp, 0); drm_kms_helper_poll_init(dev); @@ -341,6 +341,7 @@ static const struct pl111_variant_data pl110_variant = { .is_pl110 = true, .formats = pl110_pixel_formats, .nformats = ARRAY_SIZE(pl110_pixel_formats), + .fb_bpp = 16, }; /* RealView, Versatile Express etc use this modern variant */ @@ -365,6 +366,7 @@ static const struct pl111_variant_data pl111_variant = { .name = "PL111", .formats = pl111_pixel_formats, .nformats = ARRAY_SIZE(pl111_pixel_formats), + .fb_bpp = 32, }; static const struct amba_id pl111_id_table[] = { diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c index 11024ad64181..9825f6d52788 100644 --- a/drivers/gpu/drm/pl111/pl111_versatile.c +++ b/drivers/gpu/drm/pl111/pl111_versatile.c @@ -241,6 +241,7 @@ static const struct pl111_variant_data pl110_integrator = { .broken_vblank = true, .formats = pl110_integrator_pixel_formats, .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats), + .fb_bpp = 16, }; /* @@ -253,6 +254,7 @@ static const struct pl111_variant_data pl110_versatile = { .external_bgr = true, .formats = pl110_versatile_pixel_formats, .nformats = ARRAY_SIZE(pl110_versatile_pixel_formats), + .fb_bpp = 16, }; int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)