From: Melissa Wen <mwen@igalia.com>
To: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch
Cc: Joshua Ashton <joshua@froggi.es>,
alex.hung@amd.com, nicholas.kazlauskas@amd.com,
sungjoon.kim@amd.com, seanpaul@chromium.org,
bhawanpreet.lakha@amd.com,
Shashank Sharma <shashank.sharma@amd.com>,
ville.syrjala@linux.intel.com, kernel-dev@igalia.com,
laurent.pinchart+renesas@ideasonboard.com,
Melissa Wen <mwen@igalia.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH v2 05/18] drm/drm_color_mgmt: add function to attach 3D LUT props
Date: Mon, 9 Jan 2023 13:38:33 -0100 [thread overview]
Message-ID: <20230109143846.1966301-6-mwen@igalia.com> (raw)
In-Reply-To: <20230109143846.1966301-1-mwen@igalia.com>
If the driver supports user 3D LUT then it calls a drm function to
attach 3D LUT related properties according to HW caps.
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
drivers/gpu/drm/drm_color_mgmt.c | 35 ++++++++++++++++++++++++++++++++
include/drm/drm_color_mgmt.h | 3 +++
2 files changed, 38 insertions(+)
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
index 6ce48007cdd4..06503f693ecd 100644
--- a/drivers/gpu/drm/drm_color_mgmt.c
+++ b/drivers/gpu/drm/drm_color_mgmt.c
@@ -269,6 +269,41 @@ int drm_crtc_create_lut3d_mode_property(struct drm_crtc *crtc,
}
EXPORT_SYMBOL(drm_crtc_create_lut3d_mode_property);
+/**
+ * drm_crtc_enable_lut3d - enable 3D LUT properties
+ * @crtc: DRM CRTC
+ * @shaper_lut_size: the size of shaper lut
+ *
+ * This function lets the driver enable the 3D LUT color correction property
+ * on a CRTC. This includes 3D LUT and also a shaper LUT, if set. The shaper
+ * LUT property is only attached if its size is not 0 and 3D LUT is set, being
+ * therefore optional.
+ */
+void drm_crtc_enable_lut3d(struct drm_crtc *crtc,
+ uint shaper_lut_size)
+{
+ struct drm_device *dev = crtc->dev;
+ struct drm_mode_config *config = &dev->mode_config;
+
+ if (!config->lut3d_mode_property)
+ return;
+
+ drm_object_attach_property(&crtc->base,
+ config->lut3d_property, 0);
+ drm_object_attach_property(&crtc->base,
+ config->lut3d_mode_property, 0);
+
+ if (!shaper_lut_size)
+ return;
+
+ drm_object_attach_property(&crtc->base,
+ config->shaper_lut_property, 0);
+ drm_object_attach_property(&crtc->base,
+ config->shaper_lut_size_property,
+ shaper_lut_size);
+}
+EXPORT_SYMBOL(drm_crtc_enable_lut3d);
+
/**
* drm_mode_crtc_set_gamma_size - set the gamma table size
* @crtc: CRTC to set the gamma table size for
diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
index af9305925572..db2026dc825e 100644
--- a/include/drm/drm_color_mgmt.h
+++ b/include/drm/drm_color_mgmt.h
@@ -63,6 +63,9 @@ int drm_crtc_create_lut3d_mode_property(struct drm_crtc *crtc,
const struct drm_mode_lut3d_mode modes[],
unsigned int num_modes);
+void drm_crtc_enable_lut3d(struct drm_crtc *crtc,
+ uint shaper_lut_size);
+
int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
int gamma_size);
--
2.35.1
next prev parent reply other threads:[~2023-01-09 14:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 14:38 [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 01/18] drm: Add 3D LUT mode and its attributes Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 02/18] drm/drm_color_mgmt: add shaper LUT to color mgmt properties Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 03/18] drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 04/18] drm/drm_color_mgmt: add function to create 3D LUT modes supported Melissa Wen
2023-01-09 14:38 ` Melissa Wen [this message]
2023-01-09 14:38 ` [RFC PATCH v2 06/18] drm/drm_color_mgmt: set first lut3d mode as default Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 07/18] drm/amd/display: remove unused regamma condition Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 08/18] drm/amd/display: add comments to describe DM crtc color mgmt behavior Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 09/18] drm/amd/display: encapsulate atomic regamma operation Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 10/18] drm/amd/display: update lut3d and shaper lut to stream Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 11/18] drm/amd/display: handle MPC 3D LUT resources for a given context Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 12/18] drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301 Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 13/18] drm/amd/display: Define 3D LUT struct for HDR planes Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 14/18] drm/amd/display: expand array of supported 3D LUT modes Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 15/18] drm/amd/display: enable 3D-LUT DRM properties if supported Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 16/18] drm/amd/display: add user 3D LUT support to the amdgpu_dm color pipeline Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 17/18] drm/amd/display: decouple steps to reuse in shaper LUT support Melissa Wen
2023-01-09 14:38 ` [RFC PATCH v2 18/18] drm/amd/display: add user shaper LUT support to amdgpu_dm color pipeline Melissa Wen
2023-06-13 15:43 ` [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface Jacopo Mondi
2023-06-15 7:14 ` Pekka Paalanen
2023-06-15 8:07 ` Jacopo Mondi
2023-06-15 10:29 ` Pekka Paalanen
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=20230109143846.1966301-6-mwen@igalia.com \
--to=mwen@igalia.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=bhawanpreet.lakha@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=joshua@froggi.es \
--cc=kernel-dev@igalia.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nicholas.kazlauskas@amd.com \
--cc=seanpaul@chromium.org \
--cc=shashank.sharma@amd.com \
--cc=sungjoon.kim@amd.com \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
/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
all inboxes | Powered by JetHome®