All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Swati Sharma <swati2.sharma@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property
Date: Wed, 29 Jun 2022 15:36:56 +0300	[thread overview]
Message-ID: <cd36f981-1cb5-1c06-2c40-af4da13b88d5@gmail.com> (raw)
In-Reply-To: <20220628185128.19692-4-swati2.sharma@intel.com>

On 28.6.2022 21.51, Swati Sharma wrote:
> Added "scaling filter" as pipe and plane property.
> 
> v2: -Moved lib changes from 4/4 to 3/4
>      -Renaming filter enum
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>   lib/igt_kms.c | 30 ++++++++++++++++++++++++++++++
>   lib/igt_kms.h |  3 +++
>   2 files changed, 33 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index bd606548..fdb13177 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -581,6 +581,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
>   	[IGT_PLANE_ALPHA] = "alpha",
>   	[IGT_PLANE_ZPOS] = "zpos",
>   	[IGT_PLANE_FB_DAMAGE_CLIPS] = "FB_DAMAGE_CLIPS",
> +	[IGT_PLANE_SCALING_FILTER] = "SCALING_FILTER",
>   };
>   
>   const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
> @@ -593,6 +594,7 @@ const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
>   	[IGT_CRTC_ACTIVE] = "ACTIVE",
>   	[IGT_CRTC_OUT_FENCE_PTR] = "OUT_FENCE_PTR",
>   	[IGT_CRTC_VRR_ENABLED] = "VRR_ENABLED",
> +	[IGT_CRTC_SCALING_FILTER] = "SCALING_FILTER",
>   };
>   
>   const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
> @@ -910,6 +912,28 @@ const char *kmstest_connector_status_str(int status)
>   	return find_type_name(connector_status_names, status);
>   }
>   
> +enum scaling_filter {
> +       SCALING_FILTER_DEFAULT,
> +       SCALING_FILTER_NEAREST_NEIGHBOR,
^^
nit, misalignment with spaces.

> +};
> +
> +static const struct type_name scaling_filter_names[] = {
> +	{ SCALING_FILTER_DEFAULT, "Default" },
> +	{ SCALING_FILTER_NEAREST_NEIGHBOR, "Nearest Neighbor" },
> +	{}
> +};
> +
> +/**
> + * kmstest_scaling_filter_str:
> + * @filter: SCALING_FILTER_* filter value
> + *
> + * Returns: A string representing the scaling filter @filter.
> + */
> +const char *kmstest_scaling_filter_str(int filter)
> +{
> +	return find_type_name(scaling_filter_names, filter);
> +}
> +
>   static const struct type_name connector_type_names[] = {
>   	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
>   	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
> @@ -2122,6 +2146,9 @@ static void igt_plane_reset(igt_plane_t *plane)
>   	if (igt_plane_has_prop(plane, IGT_PLANE_FB_DAMAGE_CLIPS))
>   		igt_plane_set_prop_value(plane, IGT_PLANE_FB_DAMAGE_CLIPS, 0);
>   
> +	if (igt_plane_has_prop(plane, IGT_PLANE_SCALING_FILTER))
> +		igt_plane_set_prop_enum(plane, IGT_PLANE_SCALING_FILTER, "Default");
> +
>   	igt_plane_clear_prop_changed(plane, IGT_PLANE_IN_FENCE_FD);
>   	plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
>   	plane->gem_handle = 0;
> @@ -2142,6 +2169,9 @@ static void igt_pipe_reset(igt_pipe_t *pipe)
>   	if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_DEGAMMA_LUT))
>   		igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_DEGAMMA_LUT, 0);
>   
> +	if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_SCALING_FILTER))
> +		igt_pipe_obj_set_prop_enum(pipe, IGT_CRTC_SCALING_FILTER, "Default");
> +
>   	pipe->out_fence_fd = -1;
>   }
>   
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 3e674e74..4b67708d 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -107,6 +107,7 @@ enum igt_custom_edid_type {
>   const char *kmstest_encoder_type_str(int type);
>   const char *kmstest_connector_status_str(int status);
>   const char *kmstest_connector_type_str(int type);
> +const char *kmstest_scaling_filter_str(int filter);
>   
>   void kmstest_dump_mode(drmModeModeInfo *mode);
>   #define MAX_HDISPLAY_PER_PIPE 5120
> @@ -126,6 +127,7 @@ enum igt_atomic_crtc_properties {
>          IGT_CRTC_ACTIVE,
>          IGT_CRTC_OUT_FENCE_PTR,
>          IGT_CRTC_VRR_ENABLED,
> +       IGT_CRTC_SCALING_FILTER,
>          IGT_NUM_CRTC_PROPS
>   };
>   
> @@ -302,6 +304,7 @@ enum igt_atomic_plane_properties {
>          IGT_PLANE_ALPHA,
>          IGT_PLANE_ZPOS,
>          IGT_PLANE_FB_DAMAGE_CLIPS,
> +       IGT_PLANE_SCALING_FILTER,
>          IGT_NUM_PLANE_PROPS
>   };
>   

  reply	other threads:[~2022-06-29 12:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 1/4] tests/i915/kms_flip_scaled_crc: Convert tests to dynamic Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 2/4] tests/i915/kms_flip_scaled_crc: Add new tests covering modifiers and pixel-formats Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property Swati Sharma
2022-06-29 12:36   ` Juha-Pekka Heikkila [this message]
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter Swati Sharma
2022-06-29 12:37   ` Juha-Pekka Heikkila
2022-06-28 20:04 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/kms_flip_scaled_crc: New tests (rev10) Patchwork

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=cd36f981-1cb5-1c06-2c40-af4da13b88d5@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=swati2.sharma@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 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.