From patchwork Tue Jul 14 07:13:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11661837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 802D4138C for ; Tue, 14 Jul 2020 07:13:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58F272076D for ; Tue, 14 Jul 2020 07:13:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="pPUI4kqR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58F272076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 564AA6E8FD; Tue, 14 Jul 2020 07:13:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B0366E918 for ; Tue, 14 Jul 2020 07:13:20 +0000 (UTC) Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A236422227; Tue, 14 Jul 2020 07:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594710799; bh=YiVWckYXZobeNaSRkUj8azBJxqyMKc8YEr8QUsXFDdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pPUI4kqRSARdAvLmGOuFhpE0+TwvUrgdGV5zoluw7dB4jMnbpdwOyWHl6ni2MDtIU zibtyLk+sEY8qdNgniqRgz0jDnhq1F8gEZ5FU8cZ/255xX8zfgMyAeAwl2Mpfp/py3 mIgoeOwFEXDJijHL+pJwF8QkP8OK82SFgkfFbUMc= Received: by wens.tw (Postfix, from userid 1000) id F23B05FCE5; Tue, 14 Jul 2020 15:13:13 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Sam Ravnborg , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 2/5] drm/panel: simple: Set bpc from bits-per-color DT property for panel-dpi Date: Tue, 14 Jul 2020 15:13:02 +0800 Message-Id: <20200714071305.18492-3-wens@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714071305.18492-1-wens@kernel.org> References: <20200714071305.18492-1-wens@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Siarhei Siamashka Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chen-Yu Tsai Now that the device tree binding for panel-dpi has the "bits-per-color" property, parse its value and set bpc in the panel description to the given value. This would allow encoders to detect less-than-8-bits color depth and employ color dithering if possible. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/panel/panel-simple.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 13a9df44f781..0765bfa54b7a 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -433,6 +433,7 @@ static int panel_dpi_probe(struct device *dev, of_property_read_u32(np, "width-mm", &desc->size.width); of_property_read_u32(np, "height-mm", &desc->size.height); + of_property_read_u32(np, "bits-per-color", &desc->bpc); /* Extract bus_flags from display_timing */ bus_flags = 0;