From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Marijn Suijten <marijn.suijten@somainline.org>
Cc: Stephen Boyd <swboyd@chromium.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Bjorn Andersson <andersson@kernel.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org
Subject: [PATCH 01/17] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware
Date: Sat, 8 Jul 2023 04:03:51 +0300 [thread overview]
Message-ID: <20230708010407.3871346-2-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20230708010407.3871346-1-dmitry.baryshkov@linaro.org>
MDP4 and MDP5 drivers enumerate supported formats each time the plane is
created. As the list of supported image formats is constant, create
corresponding data arrays to be used by MDP4 and MDP5 drivers.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/disp/mdp_format.c | 49 +++++++++++++++++++++++++--
drivers/gpu/drm/msm/disp/mdp_kms.h | 5 +++
2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/mdp_format.c b/drivers/gpu/drm/msm/disp/mdp_format.c
index 025595336f26..ba9abe8b3acc 100644
--- a/drivers/gpu/drm/msm/disp/mdp_format.c
+++ b/drivers/gpu/drm/msm/disp/mdp_format.c
@@ -81,8 +81,8 @@ static struct csc_cfg csc_convert[CSC_MAX] = {
#define BPC0A 0
/*
- * Note: Keep RGB formats 1st, followed by YUV formats to avoid breaking
- * mdp_get_rgb_formats()'s implementation.
+ * Note: Keep mdp_rgb_formats and mdp_rgb_yuv_formats in sync when adding
+ * entries to this array.
*/
static const struct mdp_format formats[] = {
/* name a r g b e0 e1 e2 e3 alpha tight cpp cnt ... */
@@ -138,6 +138,51 @@ static const struct mdp_format formats[] = {
MDP_PLANE_PLANAR, CHROMA_420, true),
};
+const uint32_t mdp_rgb_formats[] = {
+ DRM_FORMAT_ARGB8888,
+ DRM_FORMAT_ABGR8888,
+ DRM_FORMAT_RGBA8888,
+ DRM_FORMAT_BGRA8888,
+ DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_XBGR8888,
+ DRM_FORMAT_RGBX8888,
+ DRM_FORMAT_BGRX8888,
+ DRM_FORMAT_RGB888,
+ DRM_FORMAT_BGR888,
+ DRM_FORMAT_RGB565,
+ DRM_FORMAT_BGR565,
+};
+
+size_t mdp_rgb_num_formats = ARRAY_SIZE(mdp_rgb_formats);
+
+const uint32_t mdp_rgb_yuv_formats[] = {
+ DRM_FORMAT_ARGB8888,
+ DRM_FORMAT_ABGR8888,
+ DRM_FORMAT_RGBA8888,
+ DRM_FORMAT_BGRA8888,
+ DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_XBGR8888,
+ DRM_FORMAT_RGBX8888,
+ DRM_FORMAT_BGRX8888,
+ DRM_FORMAT_RGB888,
+ DRM_FORMAT_BGR888,
+ DRM_FORMAT_RGB565,
+ DRM_FORMAT_BGR565,
+
+ DRM_FORMAT_NV12,
+ DRM_FORMAT_NV21,
+ DRM_FORMAT_NV16,
+ DRM_FORMAT_NV61,
+ DRM_FORMAT_VYUY,
+ DRM_FORMAT_UYVY,
+ DRM_FORMAT_YUYV,
+ DRM_FORMAT_YVYU,
+ DRM_FORMAT_YUV420,
+ DRM_FORMAT_YVU420,
+};
+
+size_t mdp_rgb_yuv_num_formats = ARRAY_SIZE(mdp_rgb_yuv_formats);
+
/*
* Note:
* @rgb_only must be set to true, when requesting
diff --git a/drivers/gpu/drm/msm/disp/mdp_kms.h b/drivers/gpu/drm/msm/disp/mdp_kms.h
index b0286d5d5130..11402a859574 100644
--- a/drivers/gpu/drm/msm/disp/mdp_kms.h
+++ b/drivers/gpu/drm/msm/disp/mdp_kms.h
@@ -94,6 +94,11 @@ struct mdp_format {
uint32_t mdp_get_formats(uint32_t *formats, uint32_t max_formats, bool rgb_only);
const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format, uint64_t modifier);
+extern const uint32_t mdp_rgb_formats[];
+extern size_t mdp_rgb_num_formats;
+extern const uint32_t mdp_rgb_yuv_formats[];
+extern size_t mdp_rgb_yuv_num_formats;
+
/* MDP capabilities */
#define MDP_CAP_SMP BIT(0) /* Shared Memory Pool */
#define MDP_CAP_DSC BIT(1) /* VESA Display Stream Compression */
--
2.39.2
next prev parent reply other threads:[~2023-07-08 1:04 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-08 1:03 [PATCH 00/17] drm/msm/mdp[45]: use managed memory allocations Dmitry Baryshkov
2023-07-08 1:03 ` Dmitry Baryshkov [this message]
2023-12-02 1:36 ` [PATCH 01/17] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware Abhinav Kumar
2023-12-02 11:12 ` Dmitry Baryshkov
2023-07-08 1:03 ` [PATCH 02/17] drm/msm/mdp5: use devres-managed allocation for configuration data Dmitry Baryshkov
2023-12-01 22:12 ` [Freedreno] " Abhinav Kumar
2023-07-08 1:03 ` [PATCH 03/17] drm/msm/mdp5: use devres-managed allocation for CTL manager data Dmitry Baryshkov
2023-12-01 22:15 ` Abhinav Kumar
2023-12-01 22:16 ` Abhinav Kumar
2023-07-08 1:03 ` [PATCH 04/17] drm/msm/mdp5: use devres-managed allocation for mixer data Dmitry Baryshkov
2023-12-01 22:19 ` Abhinav Kumar
2023-07-08 1:03 ` [PATCH 05/17] drm/msm/mdp5: use devres-managed allocation for pipe data Dmitry Baryshkov
2023-12-01 22:21 ` Abhinav Kumar
2023-07-08 1:03 ` [PATCH 06/17] drm/msm/mdp5: use devres-managed allocation for SMP data Dmitry Baryshkov
2023-12-01 22:23 ` Abhinav Kumar
2023-07-08 1:03 ` [PATCH 07/17] drm/msm/mdp5: use devres-managed allocation for INTF data Dmitry Baryshkov
2023-12-01 23:04 ` Abhinav Kumar
2023-07-08 1:03 ` [PATCH 08/17] drm/msm/mdp5: use drmm-managed allocation for mdp5_crtc Dmitry Baryshkov
2023-12-01 23:12 ` Abhinav Kumar
2023-07-08 1:03 ` [PATCH 09/17] drm/msm/mdp5: use drmm-managed allocation for mdp5_encoder Dmitry Baryshkov
2023-12-01 23:15 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 10/17] drm/msm/mdp5: use drmm-managed allocation for mdp5_plane Dmitry Baryshkov
2023-12-01 23:24 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 11/17] drm/msm/mdp4: use bulk regulators API for LCDC encoder Dmitry Baryshkov
2023-12-01 23:27 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 12/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_crtc Dmitry Baryshkov
2023-12-02 0:49 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 13/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_dsi_encoder Dmitry Baryshkov
2023-12-02 1:16 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 14/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_dtv_encoder Dmitry Baryshkov
2023-12-02 1:17 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 15/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_lcdc_encoder Dmitry Baryshkov
2023-12-02 1:22 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 16/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_plane Dmitry Baryshkov
2023-12-02 1:24 ` Abhinav Kumar
2023-07-08 1:04 ` [PATCH 17/17] drm/msm: drop mdp_get_formats() Dmitry Baryshkov
2023-12-02 1:25 ` Abhinav Kumar
2023-12-02 1:33 ` Abhinav Kumar
2023-12-03 11:26 ` [PATCH 00/17] drm/msm/mdp[45]: use managed memory allocations Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230708010407.3871346-2-dmitry.baryshkov@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox