Received: by 10.213.65.68 with SMTP id h4csp1349185imn; Wed, 21 Mar 2018 08:33:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELsqvwlCqJaM87Rqjcw59GJgP/DAl7Xdtdt8sfAgr1lIat96WCvYV26uJthF9THWux8GysD0 X-Received: by 2002:a17:902:848e:: with SMTP id c14-v6mr21595861plo.139.1521646389649; Wed, 21 Mar 2018 08:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521646389; cv=none; d=google.com; s=arc-20160816; b=Bh+QR38v8ybdcqX9y4vHCSekrilGClsK1BxZuO4JH/uARZHf6HY/kelWr0YdudgyPH WTXl6WPl/TseGpW7g3QcfJ4sU7h8r1uymZrwy2uVEPbzjH5+42vsuohLhxi5ooUVU8NQ j4nBZUPbOhqWDeqpjZIQTiwqcq6VVhh0F+YVFa9XHBUiFVUbqApXNif5ryNwQ86oh3HI d/brARkGMhajeQ4BJnDgf/elHKTBBBJzCfkQvsVKhFao7+UiRByqp5dBU7PDK2MjOIV3 0dUiyjtv6ijBng+adX+K9VbKVR130Zydo5uPx+Ic3Gd/1d0FHNnLIe9XoLwCsCjS24q5 a9IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5hGq+BFzGn8HZEVawJIXtxlRdiUH1ChwSKoMPYHZ/RI=; b=gBRfnjlhQeFXJx/0ZzEzvPYxE4uKGDYbuhk5gQI2C7awRUFSxjTAfbu5yIgJQnX7j/ C/wXorMoOob1hOZb7o7d/xJR5fdNNCF4yheiWvUItBwVpbqsfgW70sSjqG4P9tcWwhlL Z+ckdGoC5un6vkMAVQ5yayzwlBrFUNTa1LOXag8GxARdBdUg6e2g3a37k6lZtG8v3uQ+ QMjLKMcQM7UK994Jdl51mnhBOtNimrukG53Bo1HtaA6W7y/M0MTzFpvF/m24hubBMxKI 2LqcW8EXoOzor9iB5IhTjeDJ0QKOT46T7m6b3izgPWtNVQJKsTn2zkbJIdRreL3XNpC7 ng8w== 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 v15-v6si4557247ply.405.2018.03.21.08.32.55; Wed, 21 Mar 2018 08:33:09 -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 S1752783AbeCUPa7 (ORCPT + 99 others); Wed, 21 Mar 2018 11:30:59 -0400 Received: from mail.bootlin.com ([62.4.15.54]:47255 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbeCUPas (ORCPT ); Wed, 21 Mar 2018 11:30:48 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 561E920879; Wed, 21 Mar 2018 16:30:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id EBBB320877; Wed, 21 Mar 2018 16:30:45 +0100 (CET) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: Maxime Ripard , David Airlie , Chen-Yu Tsai , Daniel Vetter , Gustavo Padovan , Sean Paul , Paul Kocialkowski Subject: [PATCH 03/10] drm/sun4i: Don't pretend to handle ARGB8888 with the frontend Date: Wed, 21 Mar 2018 16:28:57 +0100 Message-Id: <20180321152904.22411-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180321152904.22411-1-paul.kocialkowski@bootlin.com> References: <20180321152904.22411-1-paul.kocialkowski@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. + */ 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_ARGB8888); + DRM_FORMAT_XRGB8888); sun4i_frontend_enable(frontend); } else { sun4i_backend_update_layer_formats(backend, layer->id, plane); -- 2.16.2