Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3215044imu; Sat, 24 Nov 2018 00:17:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/UvbJCYADTF8sgxHIIdf0aPigddpFOoP3SIeitJoFBnTkMJ4KuZZjmW8t19+baXhdA79VqA X-Received: by 2002:a17:902:70c6:: with SMTP id l6mr13614396plt.30.1543047436070; Sat, 24 Nov 2018 00:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047436; cv=none; d=google.com; s=arc-20160816; b=hqsXR3xYQ6Wy1cxpKemSlJb69Aylu/PLWKz98lxWNEIoFae/8CF2qz/3JOS4dscQby zwnlJdLi8apg0FLmB3U4Gwka/L9ZR6Nvk5AVmtp/K1/tcgvCg6cHRC4WvUKVvXdtwvan LbwQewbQ8PJhC65ZoEeEjeSrWDDJIzHlHTgZvXhKJmtoND+ZXIj8GvN/iQaYq13u1j3z 4eXM6B4CG4nu0D4z6AHVRUtSRelPiYj75Rzr7y9Z/4eXaoJvoe02g57604HdtNJp5hgZ +5nR1cYh1pR7D25SLc2tRjrfzWhnfsL9dGogZEnQTyF/PSQuQ6k5WqvqU/zROanqfiSh htHQ== 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=zWNVVQqf+pUfJOhqwSbK9PiH5YIyJMAHtMaxBzVJUhk=; b=gibpxqIvDZ1HGtBct6an2QkEMGq4j9wz1Z0EHGO+1tI/8kzeLiSRO1d6sMxk6772v5 vve8AzvLy0J4O74D3JpVXrF9zLBpHibTp0Ry2hvxDOg5fZATqfkjdRy1WYXkvCHuAd/2 UYAq2/wWVKXDX+8ry2DpVu7lEUzJGrxdl+jS8PdoPZu4agN4s9kcSyISM2dTTHBy7K1z XDg7iuGENMcvEBEuDOrzy0tW8SYax1lmr59FQwt/FUmTc0iY7RWjgSejFnQSsVfPTPuA Ip78e3rMxQuLZQ8MnyjoSBLV6iEjyjEbbqG8XSvIzKqgAk4uHhxxpykJH2huWwqawp5b Aqww== 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 v9si48791093pgt.464.2018.11.24.00.17.01; Sat, 24 Nov 2018 00:17:16 -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 S2502812AbeKWUKg (ORCPT + 99 others); Fri, 23 Nov 2018 15:10:36 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49460 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409013AbeKWUKg (ORCPT ); Fri, 23 Nov 2018 15:10:36 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 268F420F5D; Fri, 23 Nov 2018 10:27:08 +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 EFDB220F4A; Fri, 23 Nov 2018 10:26:36 +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 36/43] drm/sun4i: layer: Add tiled modifier support and helper Date: Fri, 23 Nov 2018 10:25:08 +0100 Message-Id: <20181123092515.2511-37-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 From: Paul Kocialkowski This introduces a list of supported modifiers for the driver, that includes the Allwinner tiled modifier, as well as a format_mod_supported callback. The callback uses both the backend and frontend helpers to indicate per-format modifier support (including for the linear modifier). Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/sun4i/sun4i_layer.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 2fb27819ad20..a828572acdbb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -113,6 +113,13 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane, sun4i_backend_layer_enable(backend, layer->id, true); } +static bool sun4i_layer_format_mod_supported(struct drm_plane *plane, + uint32_t format, uint64_t modifier) +{ + return sun4i_backend_format_is_supported(format, modifier) || + sun4i_frontend_format_is_supported(format, modifier); +} + static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = { .atomic_disable = sun4i_backend_layer_atomic_disable, .atomic_update = sun4i_backend_layer_atomic_update, @@ -125,6 +132,7 @@ static const struct drm_plane_funcs sun4i_backend_layer_funcs = { .disable_plane = drm_atomic_helper_disable_plane, .reset = sun4i_backend_layer_reset, .update_plane = drm_atomic_helper_update_plane, + .format_mod_supported = sun4i_layer_format_mod_supported, }; static const uint32_t sun4i_layer_formats[] = { @@ -155,6 +163,12 @@ static const uint32_t sun4i_layer_formats[] = { DRM_FORMAT_YVYU, }; +static const uint64_t sun4i_layer_modifiers[] = { + DRM_FORMAT_MOD_LINEAR, + DRM_FORMAT_MOD_ALLWINNER_TILED, + DRM_FORMAT_MOD_INVALID +}; + static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm, struct sun4i_backend *backend, enum drm_plane_type type) @@ -171,7 +185,7 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm, &sun4i_backend_layer_funcs, sun4i_layer_formats, ARRAY_SIZE(sun4i_layer_formats), - NULL, type, NULL); + sun4i_layer_modifiers, type, NULL); if (ret) { dev_err(drm->dev, "Couldn't initialize layer\n"); return ERR_PTR(ret); -- 2.19.1