Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3213691imu; Sat, 24 Nov 2018 00:15:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/UKrbHIGgwvy5zIwYko7NS2j+TjmQ2eXUdSSqgev4U2oHXPKkwps65ssT+K1vx4TCenA/y4 X-Received: by 2002:a63:5455:: with SMTP id e21mr17299966pgm.316.1543047317701; Sat, 24 Nov 2018 00:15:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047317; cv=none; d=google.com; s=arc-20160816; b=w7D//BgszYRGGIavNPIDD+JqaaummiiUqt512WW5Ngq4NMUWpu8QNqm9dGaQHAw2QS /iOJvKOqGphBVjTSHpChf6TAUe+Zp0HxkSIfJGTjHiUPHIg+1fZuSGdBkHcNsaxNweJN vgRboHcvpVsWG+SQcrkK5I1WPA9AEhexbUxbUT3dw281FMpfHaSrI14E7gdAQ0v3YIjv pVmyuTzDVhm4pCCyeBIaRj0WqyaUVHP+8IVtqzT1DvluHwNWdf0syNzHCpAwoeMDBfj2 GyxwvzSBzusPq12ZFvVbT2Cpjog9tNosU9Af3pf0CmfIFIFx/OjyPcbkhgrn3fBgiy33 Ix4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KCJlFejadQRw09G6HLVwIefaiMrSvFLFR4Hlmxpvh6w=; b=hTWMOhOTZ8KILz8b50b8N4oJk9fUQeyw6ANXocahb5lVv/+ZK44+6IzZNJAZMp/1sX VRnVGH0vokmXTB3tmtIisG5xxTTkZDdrPXXKtKhdfsAGpzMUvj0tDqqrhj+3Ymw4hxch k0K9FF9VSm4bLBqiZeDor0WclKdU9+gUUh1ie1qCRLkR4770lr8Rk02f2pScwtvYqHfO BJbLynfzvIm6rMT50OWiEXgbVo+SNjB/KNV4V4zSVks/BlTzelLerEpPKAl2CS+fSeW6 NQIj6qKIWo7w0fTPogBe1o+xB3vRDFKrcBlUJlva520PoIF+ytRIJ/cV8NjvOXv9Vt6J fIdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si32562120pfn.212.2018.11.24.00.15.03; Sat, 24 Nov 2018 00:15:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502623AbeKWUKH (ORCPT + 99 others); Fri, 23 Nov 2018 15:10:07 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49153 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390496AbeKWUKG (ORCPT ); Fri, 23 Nov 2018 15:10:06 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 34AA820F84; Fri, 23 Nov 2018 10:26:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id D41F9207B0; Fri, 23 Nov 2018 10:26:27 +0100 (CET) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Chen-Yu Tsai , Thomas Petazzoni , linux-sunxi@googlegroups.com, Daniel Vetter , Paul Kocialkowski Subject: [PATCH v2 02/43] drm/sun4i: frontend: Replace ARGB with XRGB as supported format Date: Fri, 23 Nov 2018 10:24:34 +0100 Message-Id: <20181123092515.2511-3-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> References: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The frontend documentation (for the A33) mentions that ARGB is supported as output, but with the alpha component always set to 0xff. In practice, this means that the alpha component cannot be preserved when going through the frontend. Since the information is lost, ARGB is not properly supported. As a result, expose the matching format supported by the frontend (both for input and output) as XRGB instead of ARGB. Since ARGB was the selected format for connecting the frontend to the backend, change it to XRGB to reflect this as well. The A31 and A80 SoCs apparently have a bit to enable proper alpha, but this is not supported at this point (see the comment already in the code). Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/sun4i/sun4i_frontend.c | 3 +-- drivers/gpu/drm/sun4i/sun4i_layer.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index ddf6cfa6dd23..3ea925584891 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -107,7 +107,7 @@ EXPORT_SYMBOL(sun4i_frontend_update_buffer); static int sun4i_frontend_drm_format_to_input_fmt(uint32_t fmt, u32 *val) { switch (fmt) { - case DRM_FORMAT_ARGB8888: + case DRM_FORMAT_XRGB8888: *val = 5; return 0; @@ -120,7 +120,6 @@ static int sun4i_frontend_drm_format_to_output_fmt(uint32_t fmt, u32 *val) { switch (fmt) { case DRM_FORMAT_XRGB8888: - case DRM_FORMAT_ARGB8888: *val = 2; return 0; diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index e0e37c2f1721..50bb16566f03 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -99,9 +99,9 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane, sun4i_frontend_update_coord(frontend, plane); sun4i_frontend_update_buffer(frontend, plane); sun4i_frontend_update_formats(frontend, plane, - DRM_FORMAT_ARGB8888); + DRM_FORMAT_XRGB8888); sun4i_backend_update_layer_frontend(backend, layer->id, - DRM_FORMAT_ARGB8888); + DRM_FORMAT_XRGB8888); sun4i_frontend_enable(frontend); } else { sun4i_backend_update_layer_formats(backend, layer->id, plane); -- 2.19.1