Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 01/10] drm/drm-crtc: Introduce sharpness strength property
Date: Thu, 7 Aug 2025 11:21:24 +0530	[thread overview]
Message-ID: <ad3693fa-a8d4-4310-8522-5795d2fedc36@intel.com> (raw)
In-Reply-To: <20250724134544.284371-2-nemesa.garg@intel.com>

Hi Nemesa,

Patch looks good to me. Just a couple of minor suggestions in the inline 
comments for slight improvements in documentation.

Also, IMO,  drm_crtc might be better than drm-crtc in the subject line.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


On 7/24/2025 7:15 PM, Nemesa Garg wrote:
> Introduces the new crtc property "SHARPNESS_STRENGTH" that allows
> the user to set the intensity so as to get the sharpness effect.
> The value of this property can be set from 0-255.
> It is useful in scenario when the output is blurry and user
> want to sharpen the pixels. User can increase/decrease the
> sharpness level depending on the content displayed.
>
> v2: Rename crtc property variable [Arun]
>      Add modeset detail in uapi doc[Uma]
> v3: Fix build issue
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
>   drivers/gpu/drm/drm_atomic_uapi.c |  4 ++++
>   drivers/gpu/drm/drm_crtc.c        | 35 +++++++++++++++++++++++++++++++
>   include/drm/drm_crtc.h            | 17 +++++++++++++++
>   3 files changed, 56 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index ecc73d52bfae..2302c2bea28a 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -419,6 +419,8 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
>   		set_out_fence_for_crtc(state->state, crtc, fence_ptr);
>   	} else if (property == crtc->scaling_filter_property) {
>   		state->scaling_filter = val;
> +	} else if (property == crtc->sharpness_strength_property) {
> +		state->sharpness_strength = val;
>   	} else if (crtc->funcs->atomic_set_property) {
>   		return crtc->funcs->atomic_set_property(crtc, state, property, val);
>   	} else {
> @@ -456,6 +458,8 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc,
>   		*val = 0;
>   	else if (property == crtc->scaling_filter_property)
>   		*val = state->scaling_filter;
> +	else if (property == crtc->sharpness_strength_property)
> +		*val = state->sharpness_strength;
>   	else if (crtc->funcs->atomic_get_property)
>   		return crtc->funcs->atomic_get_property(crtc, state, property, val);
>   	else {
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 46655339003d..1b7ce99cea5e 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -229,6 +229,25 @@ struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc)
>    * 		Driver's default scaling filter
>    * 	Nearest Neighbor:
>    * 		Nearest Neighbor scaling filter
> + * SHARPNESS_STRENGTH:
> + *	Atomic property for setting the sharpness strength/intensity by userspace.
> + *
> + *	The value of this property is set as an integer value ranging
> + *	from 0 - 255 where:
> + *
> + *	0 means feature is disabled.


Should mention here that this is the default value.

> + *
> + *	1 means minimum sharpness.
> + *
> + *	255 means maximum sharpness.

These can just be:

0: Sharpness feature is disabled (default value).

1: Minimum sharpness.

255: Maximum sharpness.


> + *
> + *	User can gradually increase or decrease the sharpness level and can
> + *	set the optimum value depending on content and

> this value will be
> + *	passed to kernel through the Uapi.

Use UAPI. Also, this  can be a separate sentence.


> + *	The setting of this property does not require modeset.
> + *	The sharpness effect takes place post blending on the final composed output.
> + *	If the feature is disabled, the content remains same without any sharpening effect
> + *	and when this feature is applied, it enhances the clarity of the content.
>    */
>   
>   __printf(6, 0)
> @@ -940,6 +959,22 @@ int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc,
>   }
>   EXPORT_SYMBOL(drm_crtc_create_scaling_filter_property);
>   
> +int drm_crtc_create_sharpness_strength_property(struct drm_crtc *crtc)
> +{
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_property *prop =
> +		drm_property_create_range(dev, 0, "SHARPNESS_STRENGTH", 0, 255);
> +
> +	if (!prop)
> +		return -ENOMEM;
> +
> +	crtc->sharpness_strength_property = prop;
> +	drm_object_attach_property(&crtc->base, prop, 0);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL(drm_crtc_create_sharpness_strength_property);
> +
>   /**
>    * drm_crtc_in_clone_mode - check if the given CRTC state is in clone mode
>    *
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index caa56e039da2..2b26b90e82e6 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -317,6 +317,16 @@ struct drm_crtc_state {
>   	 */
>   	enum drm_scaling_filter scaling_filter;
>   
> +	/**
> +	 * @sharpness_strength:
> +	 *
> +	 * Used by the user to set the sharpness intensity.
> +	 * The value ranges from 0-255.

Perhaps we can add about default value:

Default value is 0, which disables the sharpness feature.

> +	 * Any value greater than 0 means enabling the featuring

can simply be: Any value greater than 0 enables sharpening with the 
specified strength.


Regards,

Ankit

> +	 * along with setting the value for sharpness.
> +	 */
> +	u8 sharpness_strength;
> +
>   	/**
>   	 * @event:
>   	 *
> @@ -1088,6 +1098,12 @@ struct drm_crtc {
>   	 */
>   	struct drm_property *scaling_filter_property;
>   
> +	/**
> +	 * @sharpness_strength_property: property to apply
> +	 * the intensity of the sharpness requested.
> +	 */
> +	struct drm_property *sharpness_strength_property;
> +
>   	/**
>   	 * @state:
>   	 *
> @@ -1324,4 +1340,5 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
>   int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc,
>   					    unsigned int supported_filters);
>   bool drm_crtc_in_clone_mode(struct drm_crtc_state *crtc_state);
> +int drm_crtc_create_sharpness_strength_property(struct drm_crtc *crtc);
>   #endif /* __DRM_CRTC_H__ */

  parent reply	other threads:[~2025-08-07  5:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24 13:45 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-07-24 13:45 ` [PATCH 01/10] drm/drm-crtc: Introduce sharpness strength property Nemesa Garg
2025-07-25 11:22   ` [01/10] " Xaver Hugl
2025-09-09 10:28     ` Simona Vetter
2025-08-07  5:51   ` Nautiyal, Ankit K [this message]
2025-08-07  5:57     ` [PATCH 01/10] " Nautiyal, Ankit K
2025-07-24 13:45 ` [PATCH 02/10] drm/i915/display: Introduce HAS_CASF for sharpness support Nemesa Garg
2025-07-30  7:32   ` Jani Nikula
2025-07-30  7:33     ` Jani Nikula
2025-07-31  8:56       ` Garg, Nemesa
2025-07-24 13:45 ` [PATCH 03/10] drm/i915/display: Add strength and winsize register Nemesa Garg
2025-07-24 13:45 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-07-24 13:45 ` [PATCH 05/10] drm/i915/display: Compute the scaler coefficients Nemesa Garg
2025-07-24 13:45 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-07-24 13:45 ` [PATCH 07/10] drm/i915/display: Configure the second scaler Nemesa Garg
2025-07-24 13:45 ` [PATCH 08/10] drm/i915/display: Set and get the casf config Nemesa Garg
2025-07-24 13:45 ` [PATCH 09/10] drm/i915/display: Enable/disable casf Nemesa Garg
2025-07-24 13:45 ` [PATCH 10/10] drm/i915/display: Expose sharpness strength property Nemesa Garg
2025-07-28 11:42 ` [PATCH 00/10] Introduce drm sharpness property Garg, Nemesa

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=ad3693fa-a8d4-4310-8522-5795d2fedc36@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=nemesa.garg@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