From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4137814A61E for ; Wed, 29 Jun 2022 12:37:04 +0000 (UTC) Received: by mail-wm1-x334.google.com with SMTP id u12-20020a05600c210c00b003a02b16d2b8so9504710wml.2 for ; Wed, 29 Jun 2022 05:37:04 -0700 (PDT) Message-ID: Date: Wed, 29 Jun 2022 15:36:56 +0300 MIME-Version: 1.0 Content-Language: en-US To: Swati Sharma , igt-dev@lists.freedesktop.org References: <20220628185128.19692-1-swati2.sharma@intel.com> <20220628185128.19692-4-swati2.sharma@intel.com> From: Juha-Pekka Heikkila In-Reply-To: <20220628185128.19692-4-swati2.sharma@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: juhapekka.heikkila@gmail.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: 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 > --- > 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 > }; >