From patchwork Sat Jun 5 07:35:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 12301253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2EA0C47082 for ; Sat, 5 Jun 2021 07:41:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5D74261359 for ; Sat, 5 Jun 2021 07:41:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D74261359 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0wZ0PUqNswZenFkjaAFqWLEiYD/2O/EPexq0jCyTkfo=; b=ZznzPXIQrLNxVE GHWhqjtNGQp30IeSZPvg9BeOqxaSYf3Q5+yc/PtB9BoiB8PrYhJqi7PJjRcN0pohugU9cI02PZzB9 N9VUJSnOx33DQK5el9GkUjKjr1m8FVHMvrScxTQHc12J5gs4M4fELMifK+l+hAfLWw3ugQWeI0aVO ynMRzsh5/nk9x30H5dSh9ktC7v25E2Xd8ePHhPYkGXIcThsM0ATAj7TO8djovsNVd5+33tsKwmaza b/gM+VInCWJ89bdSsZalBL0F+tUirrlHhxpBThDNMzWLIYuBWrx5c4aQI+g7IztH5zrsLhXOeqbYN GllHCHriPQbb/gLjDHeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpQu5-00GDt6-R7; Sat, 05 Jun 2021 07:39:34 +0000 Received: from mail-ej1-f46.google.com ([209.85.218.46]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpQu2-00GDmE-59 for linux-arm-kernel@lists.infradead.org; Sat, 05 Jun 2021 07:39:31 +0000 Received: by mail-ej1-f46.google.com with SMTP id h24so18007659ejy.2 for ; Sat, 05 Jun 2021 00:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wbrIaaKI4niHyH2qMv2aNDzXwrJpctpYKQaNcqGlyac=; b=fQ7uILW5H1MekpLI3P/lZ6DGiQtjp5TI+TQiMTQAcMj0w5sw2CofM7pqTyMwu3QjM4 M9oGn7zcgMGQKeCiL7lfdeMXigtACC0EwN5xN20+j8ix/DjUpunVTUV+mevYTsXVaRcN Xh3FbvDYpCr2dxtMPZuhEGvZjbec5bPZWAL1zAWcEhOpg0gD/JsSw8Q/TUSSOSA9V2lu i9wTnA2mt0GehzAN8ibpIoXjNzkkd5fo577ATE1rxM80WGXpDvRxpwxere0VnRolO+lc GRxeDWyYUGQLx/IKNrLorbnz4KaFeUskr1c6SxSW3uOCVwELS15qhUJoZe2MNOE2RJke iNQw== 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:mime-version :content-transfer-encoding; bh=wbrIaaKI4niHyH2qMv2aNDzXwrJpctpYKQaNcqGlyac=; b=o55E88XL6yZKhxMfIAlaQwbnzcsX8k9i854bctC45G7f6IWiiBOaJ+AGofEWgpL/l9 vTYzdcIrnHqCRHN7CwI69Fq3pBVPUh7DIQ/YDFFqmzr8QO0KWosfvwvMtItl9RpMnhCj /fFcJxTYAkRUFC4Hlp7D+l8yVqwnH/PucOAPbgKITWv49/XKvp4H1T/5Qpq7RyjUR0+D TnNbI4UVM32HPEofFto4EXab9gc/61vSNxndMBElmGCjiLkw2ecd0aofhIdcP0SW8JVN tO2HE6UiIRP7mK+vNyrxEcwDpuVL0vf9GascAz2sz4NMVRpixfHii2RzBAdkwtCbtasr 8qog== X-Gm-Message-State: AOAM533M66TYmx/2zKBvoMKHd8oArfDZIPDaEprCuw9U97QtHy6+APAb MJBSliRfdl4x8x9LWB3aZrE= X-Google-Smtp-Source: ABdhPJxZS46vj0gx1a8g5jF08xoc9nDXTbE/elS9v0x0sE5DVYzWQwkWvYxzDPddWd0hCFzkEKpywQ== X-Received: by 2002:a17:906:b748:: with SMTP id fx8mr8315876ejb.477.1622878587956; Sat, 05 Jun 2021 00:36:27 -0700 (PDT) Received: from kista.localdomain (cpe-86-58-17-133.cable.triera.net. [86.58.17.133]) by smtp.gmail.com with ESMTPSA id t5sm3792159eje.29.2021.06.05.00.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Jun 2021 00:36:26 -0700 (PDT) From: Jernej Skrabec To: mripard@kernel.org, wens@csie.org Cc: airlied@linux.ie, daniel@ffwll.ch, daniel.stone@collabora.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Piotr Oniszczuk , Jernej Skrabec Subject: [PATCH] drm/sun4i: de3: Be explicit about supported modifiers Date: Sat, 5 Jun 2021 09:35:34 +0200 Message-Id: <20210605073534.3786194-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210605_003930_210601_BDD72BC2 X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Piotr Oniszczuk Currently only linear formats are supported in sun4i-drm driver, but SoCs like H6 supports AFBC variant of some of them in multiple cores (GPU, VPU, DE3). Panfrost already implements AFBC compression and is sometimes confused what should be default choice (linear, AFBC) if DRM driver is not explicit about modifier support (MiniMyth2 distro with MythTV app). After some discussion with Daniel Stone on #panfrost IRC, it was decided to make modifiers in sun4i-drm explicit, to avoid any kind of guessing, not just in panfrost, but everywhere. In fact, long term idea is to make modifier parameter in drm_universal_plane_init() mandatory (non NULL). Signed-off-by: Piotr Oniszczuk Signed-off-by: Jernej Skrabec Acked-by: Daniel Stone --- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 7 ++++++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 0db164a774a1..e779855bcd6e 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -370,6 +370,11 @@ static const u32 sun8i_ui_layer_formats[] = { DRM_FORMAT_XRGB8888, }; +static const uint64_t sun8i_layer_modifiers[] = { + DRM_FORMAT_MOD_LINEAR, + DRM_FORMAT_MOD_INVALID +}; + struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm, struct sun8i_mixer *mixer, int index) @@ -392,7 +397,7 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm, &sun8i_ui_layer_funcs, sun8i_ui_layer_formats, ARRAY_SIZE(sun8i_ui_layer_formats), - NULL, type, NULL); + sun8i_layer_modifiers, type, NULL); if (ret) { dev_err(drm->dev, "Couldn't initialize layer\n"); return ERR_PTR(ret); diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index 46420780db59..1c86c2dd0bbf 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -534,6 +534,11 @@ static const u32 sun8i_vi_layer_de3_formats[] = { DRM_FORMAT_YVU422, }; +static const uint64_t sun8i_layer_modifiers[] = { + DRM_FORMAT_MOD_LINEAR, + DRM_FORMAT_MOD_INVALID +}; + struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm, struct sun8i_mixer *mixer, int index) @@ -560,7 +565,8 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm, ret = drm_universal_plane_init(drm, &layer->plane, 0, &sun8i_vi_layer_funcs, formats, format_count, - NULL, DRM_PLANE_TYPE_OVERLAY, NULL); + sun8i_layer_modifiers, + DRM_PLANE_TYPE_OVERLAY, NULL); if (ret) { dev_err(drm->dev, "Couldn't initialize layer\n"); return ERR_PTR(ret);