Received: by 10.213.65.68 with SMTP id h4csp486005imn; Thu, 22 Mar 2018 01:38:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELttfvCg3wCEgM6L9Ewa/POpswaJByfN5Y/pesGdn8CBf+f4wGL4gahHyp2C64OsMHtB3yUj X-Received: by 2002:a17:902:20c2:: with SMTP id v2-v6mr24751236plg.82.1521707917695; Thu, 22 Mar 2018 01:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521707917; cv=none; d=google.com; s=arc-20160816; b=VbQlcnCGl1zMuzlPcZQ3kBYN6ItUUKrEQfRmkb2ppEv7A+EZdENfVFHA1NQKYEFWyg nIqC8i8fx5EjlyL54HEeC2izcPITMJvEegKDEcIpdYkiWswqvJNKx+mIEehdg7mRi84M KBwH6BR9ac6xoxZ8KXq1lsvMI5ZRtrnLIB+XPSlfeUA5To1LEuldF0pRSRX/Fkg2LBxV 3MKB5kWzuFwBHq4m0+s7MOAzxKNwnLe2pSLZYVykxETGj+Haayd8l3DlBtVpvORWkZ6f mQOmqhrdWWXG26OD8ubOiaYFVSuohaofNzCPxfwiNiqDraLhXIDgwvaM/YoI0BIPrmZ2 CWZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=Ze+3ofPOq49LFe8M2wGyjiPnjL5G1prT0ttd//ZUr2E=; b=EA6LNFoU8UuEZhkLLhLemLyizRZjRgojFm9xBSq3IS20OLfTA2K1uogtLQiiTfzxZv oeduaxowq6jJ0+SxfByjBSGhbjZ2EB6TGVVOiDWt0e2uk9ehdp1T0Y37BKlFTG0FerY0 COLQrdimy6Y/JdgqoEfCokPlKeENW4E6A5muiuHTvjO5A/lyNpfrXxILBzUQqgH1pEt4 G2GLstQkxAtlFpyN1ToJ3ag5eUgDRAd8rZ5jvJloaEt0xNV2bDhC+bHwvVvCblRb9IsQ J2soKLEha8YPlGKuB5ANIHmi1GhcIVe137auHUwXzd4h+TFt+2wySoLT+WR5z1mQI3lU 1AmQ== 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 q1si4094749pgc.515.2018.03.22.01.38.23; Thu, 22 Mar 2018 01:38:37 -0700 (PDT) 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 S1752651AbeCVIh3 (ORCPT + 99 others); Thu, 22 Mar 2018 04:37:29 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40319 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751768AbeCVIhY (ORCPT ); Thu, 22 Mar 2018 04:37:24 -0400 Received: by mail-wm0-f66.google.com with SMTP id t6so14472625wmt.5 for ; Thu, 22 Mar 2018 01:37:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ze+3ofPOq49LFe8M2wGyjiPnjL5G1prT0ttd//ZUr2E=; b=debJ4EKHlyjNl/29HnYGz6ZmZPxj+o+mpg7WDl3fJdh5BKSmfSpkxXOiLGMGPrGe1P aK+7sGj0FENTRBDxuo/aMfSXQZZfgsjkC0LqjlyTOvWgWBYtJc7KxcXrgn2uTZ1sTFo4 3hvx8BpeaskCVctZ9DMC4nOVzjJd7/0GHBW9wQfNrfNwsBoj0lTaPMQ6wQQWMC9Ve7n7 2gSfGQuHdMFA/nBbyT8B5hsMijLY/d3ijxYq2oQizylzxDCTbekRHpQR6fdWDVt++4+v tj2TY8fFahKUlPspYZ9RA04Z2hpBhUrT17+LPodFPuulmU7tze8PrJtL6g1iuFthFXz4 nU/g== X-Gm-Message-State: AElRT7GIqOGPwN9IJZmtIk1TlsGDFkmHr4DLT5JCHleHxGLQBXHmiQ9q Z5kN8c8xDLvytZi9wfEPzcX9M0Ij X-Received: by 10.80.207.129 with SMTP id h1mr24426203edk.207.1521707842906; Thu, 22 Mar 2018 01:37:22 -0700 (PDT) Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com. [209.85.128.182]) by smtp.gmail.com with ESMTPSA id 94sm4389107edk.43.2018.03.22.01.37.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 01:37:22 -0700 (PDT) Received: by mail-wr0-f182.google.com with SMTP id s10so7750928wra.13 for ; Thu, 22 Mar 2018 01:37:22 -0700 (PDT) X-Received: by 10.223.151.1 with SMTP id r1mr18575453wrb.126.1521707842288; Thu, 22 Mar 2018 01:37:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.164.129 with HTTP; Thu, 22 Mar 2018 01:37:01 -0700 (PDT) In-Reply-To: <1521706988.1175.4.camel@bootlin.com> References: <20180321152904.22411-1-paul.kocialkowski@bootlin.com> <20180321152904.22411-4-paul.kocialkowski@bootlin.com> <1521706988.1175.4.camel@bootlin.com> From: Chen-Yu Tsai Date: Thu, 22 Mar 2018 16:37:01 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 03/10] drm/sun4i: Don't pretend to handle ARGB8888 with the frontend To: Paul Kocialkowski Cc: David Airlie , linux-kernel , dri-devel , Daniel Vetter , Maxime Ripard , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 22, 2018 at 4:23 PM, Paul Kocialkowski wrote: > Hi Chen-Yu, > > On Thu, 2018-03-22 at 14:47 +0800, Chen-Yu Tsai wrote: >> On Wed, Mar 21, 2018 at 11:28 PM, Paul Kocialkowski >> wrote: >> > It turns out that the frontend is not capable of preserving the >> > alpha >> > component (that is always set to 0xff), so only support XRGB8888 >> > instead. >> > >> > Signed-off-by: Paul Kocialkowski >> > --- >> > drivers/gpu/drm/sun4i/sun4i_backend.c | 4 ++++ >> > drivers/gpu/drm/sun4i/sun4i_frontend.c | 3 +-- >> > drivers/gpu/drm/sun4i/sun4i_layer.c | 4 ++-- >> > 3 files changed, 7 insertions(+), 4 deletions(-) >> > >> > diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c >> > b/drivers/gpu/drm/sun4i/sun4i_backend.c >> > index b98dafda52f8..274a1db6fa8e 100644 >> > --- a/drivers/gpu/drm/sun4i/sun4i_backend.c >> > +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c >> > @@ -440,6 +440,10 @@ static bool >> > sun4i_backend_plane_uses_frontend(struct drm_plane_state *state) >> > if (IS_ERR(backend->frontend)) >> > return false; >> > >> > + /* >> > + * TODO: Don't use the frontend for x2/x4 scaling and allow >> > RGB formats >> > + * with an alpha component then. >> >> This and the commit log are kind of conflicting. Is it just the scalar >> that doesn't >> work with an alpha component, or the whole frontend? > > It's the whole frontend that does not support alpha in its output > formats. I'm talking about scaling here because that's still the main > reason to use the frontend. On the other hand, the backend allows > integer scaling with an alpha component, hence the comment. I see. I parsed the TODO note incorrectly. > Do you think I need to rework the comment/commit log? I think Allow integer scaling with alpha using just the backend. would be slightly clearer. Thanks ChenYu > Thanks for the review, > > Paul > >> > + */ >> > return sun4i_backend_plane_uses_scaler(state); >> > } >> > >> > 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 eb93df445a10..15238211a61a 100644 >> > --- a/drivers/gpu/drm/sun4i/sun4i_layer.c >> > +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c >> > @@ -100,9 +100,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, plane, >> > - DRM_FORMAT_ARGB8 >> > 888); >> > + DRM_FORMAT_XRGB8 >> > 888); >> > sun4i_frontend_enable(frontend); >> > } else { >> > sun4i_backend_update_layer_formats(backend, layer- >> > >id, plane); >> > -- >> > 2.16.2 >> > >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > -- > Paul Kocialkowski, Bootlin (formerly Free Electrons) > Embedded Linux and kernel engineering > https://bootlin.com