Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3061945pxb; Mon, 18 Oct 2021 07:31:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOxliwTwliH0wvXR/8Vc1JuRZ2XxQdPhx0qK82FpA393m5p+zoGdZd7wHCm51zqp9o0TgM X-Received: by 2002:aa7:cd53:: with SMTP id v19mr25574689edw.8.1634567471422; Mon, 18 Oct 2021 07:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634567471; cv=none; d=google.com; s=arc-20160816; b=Jig8PmCJWxphTrXMIuwJAw/y6F0i7HTAjAMFM37AdTOHZL9KGDIHnIA851XPn70opW iC7HcJQggwc1paqvc71640AQ3j7hwrlYyjVcYf/Gn8GkVxRc2gveOzfGjed5sqiBJL3r 9D3GohdCkFXkN/ortZNvsgZCahtxR3vNRzeNrJ0/zCgLTA6ZBaeLQdBZGisHKN7ywG4A a4hMsWxA4Gp6YJNYWVHMiwTp36qFgazugqiLl0ATSs3mP7GJzfokT0zAFs9j3mcqloq9 H4AAU4v6NI/6P+e3e/+ZFpdTBSGwZRboE3ajb8WZooNw4/7b2ykZlgdOTxR8tPAIsZTW PLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5H2hhzuRrvmA/4yp/fNI9riPBu8q3rix23PsNkWExX4=; b=csnNGWB0I+vzYiR+wysKrJ5f1GB0ranexZ4ueeKP3ZoyIapEs4q2md11KbqtxE0+Ov P9vqbpLu+Br0BALlNtoMMtgygwd9HiLD2pHXdfJVhOJeIpawT4lB/IReCIjJvyP56crX 48KCdT0p6tQtS5+71jpAyyQiAdyKI1LsfHO3bNBeUaZ1003jCrq+MbwbojgbrmzM/ceK 0b1gjIEjqTBwRJYOIcpLcClG5tfRKsC/5wU/fccIpWHHJULmjU4ah6iVW7fJvMuwYlTP 9uqGBJo+3WoW3Z4nZGPdB70n8ClGr1lFQ7lXL+ABLqz08Lov9CKOAixodCdArPTNODEh tqHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=EMOfL+zM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks8si19162741ejb.360.2021.10.18.07.30.47; Mon, 18 Oct 2021 07:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=EMOfL+zM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232117AbhJRObG (ORCPT + 99 others); Mon, 18 Oct 2021 10:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbhJRObA (ORCPT ); Mon, 18 Oct 2021 10:31:00 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9074EC061745 for ; Mon, 18 Oct 2021 07:28:49 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id r18so41777844wrg.6 for ; Mon, 18 Oct 2021 07:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5H2hhzuRrvmA/4yp/fNI9riPBu8q3rix23PsNkWExX4=; b=EMOfL+zMR3n+voUDGnHpGA8hK7xhP9l2G8bv3uB/w1/ggpy9RAab8rmCLNjg+JMAKL shO2XE70RQJVyJMZh1GblHFGqx1aA9unr15AqjahO64JHvpYWLjt68wArBhL5KvS1wv0 nGEYMDqxG8yRuf5nJhmO/sDDorJeiXQXHRbSRFW0Hn0mTF0uHTShYR1w/ZqNh7oDKBks 2gg10Jp+HCWWSANx6TIBX0i3EExfT2L0xruyTQjPgiSsaAEL55rYU61aLNfhoXmw8z1W 9GYUJJGwH9ouxedT1vRxznnXwmt+IiZnmyi1sjxJQdNTUC6PL4+HHaor3TV5CVISMSBp b3dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5H2hhzuRrvmA/4yp/fNI9riPBu8q3rix23PsNkWExX4=; b=3gCsO0V93+hMsKXcCPCsC1bO0Mk9mPL173lM3dpqdo67/YEqpVns39xNEj3CDAySCy OG+xS1VzfJloeH3I4Bnw0ynw+mfC8c+qJ6Kw+kvtbfq09u1OASRW5v9Ig72/XoHrIGMk 1GXbqVnnLd4iAI/LfgIdmt1LHeXRgEzXSewbA7KkxERKpcX0ElU6KkslqA3wcyJtbzAz 32fbzLBA+oPJGnjET9bD0ZKGxvkU8ipjiBTTV3c+4Wwdyx6D6gt1EMIt3AA3uxY7L/Gm xu7RwOFsHdRcHJu+nDydtprYHlbm4tf6TsgYW01B+vNV7lp7qg9Yo/greYZF1VeenP2b qHow== X-Gm-Message-State: AOAM531o/85Q4qiFwAngv/CywTYmq8/xwiqU1EYw4d9WmzY2oVukions Xef2kUgkgNWnMesR7lktWOuo2w== X-Received: by 2002:adf:bb12:: with SMTP id r18mr36073651wrg.313.1634567328043; Mon, 18 Oct 2021 07:28:48 -0700 (PDT) Received: from localhost.localdomain ([2001:861:44c0:66c0:2dd7:d5eb:6e87:f924]) by smtp.gmail.com with ESMTPSA id b3sm12908495wrp.52.2021.10.18.07.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 07:28:47 -0700 (PDT) From: Neil Armstrong To: tomba@kernel.org Cc: linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, Benoit Parrot , Neil Armstrong Subject: [PATCH v6 3/9] drm/omap: Add ovl checking funcs to dispc_ops Date: Mon, 18 Oct 2021 16:28:36 +0200 Message-Id: <20211018142842.2511200-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211018142842.2511200-1-narmstrong@baylibre.com> References: <20211018142842.2511200-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2331; i=narmstrong@baylibre.com; h=from:subject; bh=koW8JWicC/ikxRWVypGZv81IJqBAw7vmCwy+5yAxnpw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBhbYSFU+lQsT2xLcINix4tQSeHdOJZ9AaFtpUCP2s/ W9Lto32JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCYW2EhQAKCRB33NvayMhJ0aiPD/ 0UhV4dm089UmDROSLcsjGPn3RsOpemnxIiXeCTyg7MxV38TSWTqd96dG5hL5vs4kzy0ity7rtleZTN PP2XsOnBBdN9Ku0Aa1iVqDbSCbxoZm4CTnkhSLAYzrCG4f9xtd6PpXO5Upi5/Z7EOSAiiBZwk1a/dV VjSPtsY8kqOlO6rZqOmsR3hPAWVANl62bQF7i1FwL3QQqiSoHZDDS4r6jE1b10l7PknPB60IIqMVM3 wJ4Uin/8Me4nOt+uv4IM+c5WYjY1fzEZFNESsASnVRg5MvGHhEc0QiFOxhXQ62W7aE4/Ldn/51tEIb MnzDIX6Nl28Ahf9P8TpD/PnHwdg6nFP8xNHrSh0dMO1soUX7EwB9Z/3SH1HLk5yB9OS/tqYOaYYL6z W4IRbhNFvC74RmqJKEDTrE0bQ8QyfzXASQVwENHASIESK9q2NpRYQx1E7WJI0OvgDYzB37gTARXE8m PEfh5DCqeP0EGZS44ymX/5+8zza4H/UaHHN/DpRUepF81+vQeoC+YFWlMyj5FDCLrs+QjMASyulBw/ hXW1Hoh6pG4v2rixs27yKoFMjCR2txVGAQAuiDdyFTPM8U3U5vgyFs9I4QA4qHZwcgKXXFTwjYDOiZ rsDyzoq4+kF+J3PHI7/FcZLU5qkH4E6JpPHa7HXTm6/fOzuV/nBdxx3251nQ== X-Developer-Key: i=narmstrong@baylibre.com; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Benoit Parrot In order to be able to dynamically assign overlays to planes we need to be able to asses the overlay capabilities. Add a helper function to be able to retrieve the supported capabilities of an overlay. And export the function to check if a fourcc is supported on a given overlay. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong --- drivers/gpu/drm/omapdrm/dss/dispc.c | 9 +++++++-- drivers/gpu/drm/omapdrm/dss/dss.h | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 5ac90ba6b76d..dd36db75b4b4 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -1281,8 +1281,8 @@ static u32 dispc_ovl_get_burst_size(struct dispc_device *dispc, return dispc->feat->burst_size_unit * 8; } -static bool dispc_ovl_color_mode_supported(struct dispc_device *dispc, - enum omap_plane_id plane, u32 fourcc) +bool dispc_ovl_color_mode_supported(struct dispc_device *dispc, + enum omap_plane_id plane, u32 fourcc) { const u32 *modes; unsigned int i; @@ -2489,6 +2489,11 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc, return 0; } +enum omap_overlay_caps dispc_ovl_get_caps(struct dispc_device *dispc, enum omap_plane_id plane) +{ + return dispc->feat->overlay_caps[plane]; +} + #define DIV_FRAC(dividend, divisor) \ ((dividend) * 100 / (divisor) - ((dividend) / (divisor) * 100)) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h index 14c39f7c3988..4ff02fbc0e71 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.h +++ b/drivers/gpu/drm/omapdrm/dss/dss.h @@ -398,6 +398,9 @@ const u32 *dispc_ovl_get_color_modes(struct dispc_device *dispc, enum omap_plane_id plane); void dispc_ovl_get_max_size(struct dispc_device *dispc, u16 *width, u16 *height); +bool dispc_ovl_color_mode_supported(struct dispc_device *dispc, + enum omap_plane_id plane, u32 fourcc); +enum omap_overlay_caps dispc_ovl_get_caps(struct dispc_device *dispc, enum omap_plane_id plane); u32 dispc_read_irqstatus(struct dispc_device *dispc); void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask); -- 2.25.1