All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: dri-devel@lists.freedesktop.org, wayland-devel@lists.freedesktop.org
Subject: Re: [RFC PATCH v3 17/23] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
Date: Fri, 8 Dec 2023 14:33:30 +0200	[thread overview]
Message-ID: <20231208143330.30b58da8@eldfell> (raw)
In-Reply-To: <20231108163647.106853-18-harry.wentland@amd.com>

[-- Attachment #1: Type: text/plain, Size: 5283 bytes --]

On Wed, 8 Nov 2023 11:36:36 -0500
Harry Wentland <harry.wentland@amd.com> wrote:

> With the introduction of the pre-blending color pipeline we
> can no longer have color operations that don't have a clear
> position in the color pipeline. We deprecate all existing
> plane properties. For upstream drivers those are:
>  - COLOR_ENCODING
>  - COLOR_RANGE
> 
> Userspace that registers with the
> DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE will be permitted to set
> the COLOR_PIPELINE plane property and drm_colorop properties.
> But it won't be allowed to set COLOR_ENCODING and
> COLOR_RANGE. Userspace that does not set this client cap
> will not be permitted to touch the color pipeline.
> 
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 23 ++++++++++++++++++++++-
>  drivers/gpu/drm/drm_ioctl.c       |  7 +++++++
>  include/drm/drm_file.h            |  7 +++++++
>  include/uapi/drm/drm.h            | 15 +++++++++++++++
>  4 files changed, 51 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index c6629fdaa114..69c56982e2d0 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -610,10 +610,26 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
>  	} else if (property == plane->zpos_property) {
>  		state->zpos = val;
>  	} else if (property == plane->color_encoding_property) {
> +		if (file_priv->plane_color_pipeline) {
> +			drm_dbg_atomic(dev,
> +				       "Setting COLOR_PIPELINE plane property not permitted when DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE is set\n");
> +			return -EINVAL;
> +		}
>  		state->color_encoding = val;
>  	} else if (property == plane->color_range_property) {
> +		if (file_priv->plane_color_pipeline) {
> +			drm_dbg_atomic(dev,
> +				       "Setting COLOR_PIPELINE plane property not permitted when DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE is set\n");
> +			return -EINVAL;
> +		}
>  		state->color_range = val;

The above two cases mention COLOR_PIPELINE when they should probably
refer to something else.


Thanks,
pq

>  	} else if (property == plane->color_pipeline_property) {
> +		if (!file_priv->plane_color_pipeline) {
> +			drm_dbg_atomic(dev,
> +				       "Setting COLOR_PIPELINE plane property not permitted unless DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE is set\n");
> +			return -EINVAL;
> +		}
> +
>  		/* find DRM colorop object */
>  		struct drm_colorop *colorop = NULL;
>  		colorop = drm_colorop_find(dev, file_priv, val);
> @@ -1158,6 +1174,12 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
>  		break;
>  	}
>  	case DRM_MODE_OBJECT_COLOROP: {
> +		if (!file_priv->plane_color_pipeline) {
> +			drm_dbg_atomic(prop->dev,
> +				       "[OBJECT:%d] is a colorop but DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE not set\n",
> +				       obj->id);
> +			ret = -EINVAL;
> +		}
>  		struct drm_colorop *colorop = obj_to_colorop(obj);
>  		struct drm_colorop_state *colorop_state;
>  
> @@ -1170,7 +1192,6 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
>  		ret = drm_atomic_colorop_set_property(colorop,
>  				colorop_state, file_priv,
>  				prop, prop_value);
> -
>  		break;
>  	}
>  	default:
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index 44fda68c28ae..0d869658e13e 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -361,6 +361,13 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
>  			return -EINVAL;
>  		file_priv->writeback_connectors = req->value;
>  		break;
> +	case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE:
> +		if (!file_priv->atomic)
> +			return -EINVAL;
> +		if (req->value > 1)
> +			return -EINVAL;
> +		file_priv->plane_color_pipeline = req->value;
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index e1b5b4282f75..bf11b646c898 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -204,6 +204,13 @@ struct drm_file {
>  	 */
>  	bool writeback_connectors;
>  
> +	/**
> +	 * @plane_color_pipeline:
> +	 *
> +	 * True if client understands plane color pipelines
> +	 */
> +	bool plane_color_pipeline;
> +
>  	/**
>  	 * @was_master:
>  	 *
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 841d393fb84e..2576b170e8d0 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -842,6 +842,21 @@ struct drm_get_cap {
>   */
>  #define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS	5
>  
> +/**
> + * DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
> + *
> + * If set to 1, the DRM core will
> + * - expose plane COLOR_PIPELINE properties for pre-blending color management.
> + * - reject setting of these plane properties:
> + *   - COLOR_ENCODING
> + *   - COLOR_RANGE
> + *
> + * The client must enable &DRM_CLIENT_CAP_ATOMIC first.
> + *
> + * This capability is currently in development.
> + */
> +#define DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE	7
> +
>  /* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
>  struct drm_set_client_cap {
>  	__u64 capability;


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-12-08 12:33 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 16:36 [RFC PATCH v3 00/23] Color Pipeline API w/ VKMS Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 01/23] drm: Don't treat 0 as -1 in drm_fixp2int_ceil Harry Wentland
2023-12-06 12:05   ` Melissa Wen
2023-12-08 11:12     ` Melissa Wen
2023-12-08 11:12       ` Melissa Wen
2023-11-08 16:36 ` [RFC PATCH v3 02/23] drm: Add helper for conversion from signed-magnitude Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 03/23] drm/vkms: Create separate Kconfig file for VKMS Harry Wentland
2023-12-06 12:14   ` Melissa Wen
2023-11-08 16:36 ` [RFC PATCH v3 04/23] drm/vkms: Add kunit tests for VKMS LUT handling Harry Wentland
2023-11-09  8:38   ` kernel test robot
2023-11-09 22:05   ` Arthur Grillo
2023-11-10 20:24     ` Arthur Grillo
2023-12-07 14:30   ` Pekka Paalanen
2023-12-19 19:36     ` Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 05/23] drm/vkms: Avoid reading beyond LUT array Harry Wentland
2023-11-10 12:42   ` Arthur Grillo
2023-12-06 12:18     ` Melissa Wen
2023-12-06 13:15       ` Melissa Wen
2023-11-08 16:36 ` [RFC PATCH v3 06/23] drm/doc/rfc: Describe why prescriptive color pipeline is needed Harry Wentland
2023-12-08 11:20   ` Pekka Paalanen
2023-12-08 11:40   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 07/23] drm/colorop: Introduce new drm_colorop mode object Harry Wentland
2023-12-08 11:27   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 08/23] drm/colorop: Add TYPE property Harry Wentland
2023-11-09 11:40   ` kernel test robot
2023-12-08 11:37   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 09/23] drm/color: Add 1D Curve subtype Harry Wentland
2023-12-08 11:44   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 10/23] drm/colorop: Add BYPASS property Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 11/23] drm/colorop: Add NEXT property Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 12/23] drm/colorop: Add atomic state print for drm_colorop Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 13/23] drm/plane: Add COLOR PIPELINE property Harry Wentland
2023-12-08 11:53   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 14/23] drm/colorop: Add NEXT to colorop state print Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 15/23] drm/vkms: Add enumerated 1D curve colorop Harry Wentland
2023-12-08 12:15   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 16/23] drm/vkms: Add kunit tests for linear and sRGB LUTs Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 17/23] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE Harry Wentland
2023-12-08 12:33   ` Pekka Paalanen [this message]
2023-11-08 16:36 ` [RFC PATCH v3 18/23] drm/colorop: Add 3x4 CTM type Harry Wentland
2023-12-08 12:39   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 19/23] drm/vkms: Pull apply_colorop out of pre_blend_color_transform Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 20/23] drm/vkms: Use s32 for internal color pipeline precision Harry Wentland
2023-12-08 13:01   ` Pekka Paalanen
2023-11-08 16:36 ` [RFC PATCH v3 21/23] drm/vkms: add 3x4 matrix in color pipeline Harry Wentland
2023-12-08 13:11   ` Pekka Paalanen
2024-01-04 16:12     ` Harry Wentland
2023-11-08 16:36 ` [RFC PATCH v3 22/23] drm/tests: Add a few tests around drm_fixed.h Harry Wentland
2023-11-09 14:02   ` kernel test robot
2023-11-08 16:36 ` [RFC PATCH v3 23/23] drm/vkms: Add tests for CTM handling Harry Wentland
2023-12-08 13:32   ` Pekka Paalanen
2024-01-04 16:09     ` Harry Wentland
2024-02-19 11:02 ` [RFC PATCH v3 00/23] Color Pipeline API w/ VKMS Shankar, Uma

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=20231208143330.30b58da8@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=wayland-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.