From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: igt-dev@lists.freedesktop.org, Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH i-g-t v2] tests/kms_properties: rework immutability checks
Date: Fri, 25 Oct 2024 09:00:45 +0300 [thread overview]
Message-ID: <Zxs0DXIKQDtsCO4k@intel.com> (raw)
In-Reply-To: <Zxsx-askWn17OxIU@intel.com>
On Fri, Oct 25, 2024 at 08:51:53AM +0300, Ville Syrjälä wrote:
> On Thu, Oct 24, 2024 at 09:29:03PM +0300, Dmitry Baryshkov wrote:
> > On Fri, 18 Oct 2024 at 15:01, Dmitry Baryshkov
> > <dmitry.baryshkov@linaro.org> wrote:
> > >
> > > Following the discussion on IRC, it is actually an error to require that
> > > properties that can not be chaged are marked as immutable.
> > >
> > > First of all, it creates inconsistent uAPI. Some drivers might have an
> > > immutable property, while others will have it mutable. Yes, there are
> > > known examples for such behaviour (e.g. zpos), but they are clearly
> > > documented in this way.
> > >
> > > Second, by the nature of the flag, the DRM_MODE_PROP_IMMUTABLE defines
> > > more of the 'direction' of the property (whether it is set by the kernel
> > > or it is expected to be set by the userspace) rather than simply states
> > > that there is no way for the userspace to change the property.
> > >
> > > Rework the immutability checks to verify that the properties defined as
> > > immutable have this flag set. Keep the "immutable if single value"
> > > property just for the "zpos" property.
> > >
> > > Fixes: 29ae12bd764e ("tests/kms_properties: Validate properties harder")
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Link: https://oftc.irclog.whitequark.org/dri-devel/2024-07-16#33374622
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >
> > Gracious ping for the patch. We need it to be able to proceed with the
> > HDMI rework for the drm/msm driver, otherwise IGT tests fail.
> >
> > >
> > > ---
> > > Changes since v1:
> > > - Moved GAMMA_LUT_SIZE and DEGAMMA_LUT_SIZE to DRM_MODE_OBJECT_CRTC.
> > > - Added debug print to help debugging possible issues.
> > > ---
> > > tests/kms_properties.c | 110 ++++++++++++++++++++++++++++++++---------
> > > 1 file changed, 87 insertions(+), 23 deletions(-)
> > >
> > > diff --git a/tests/kms_properties.c b/tests/kms_properties.c
> > > index a93c93cccf64..57f07e69909a 100644
> > > --- a/tests/kms_properties.c
> > > +++ b/tests/kms_properties.c
> > > @@ -416,16 +416,80 @@ static void test_object_invalid_properties(igt_display_t *display,
> > > test_invalid_properties(display->drm_fd, id, type, output->id, DRM_MODE_OBJECT_CONNECTOR, atomic);
> > > }
> > >
> > > +enum prop_imm_flags {
> > > + IMMUTABLE_REQ,
> > > + IMMUTABLE_IF_SINGLE_VALUE,
> > > +};
> > > +
> > > +static const struct {
> > > + uint32_t obj_type;
> > > + const char *name;
> > > + enum prop_imm_flags flags;
> > > +} prop_settings[] = {
> > > + /* generic */
> > > + { DRM_MODE_OBJECT_CONNECTOR, "EDID", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "PATH", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "TILE", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "WRITEBACK_PIXEL_FORMATS", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "non-desktop", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "panel orientation" ,IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "privacy-screen hw-state", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "subconnector", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "suggested X", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "suggested Y", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CONNECTOR, "vrr_capable", IMMUTABLE_REQ },
> > > +
> > > + { DRM_MODE_OBJECT_CRTC, "DEGAMMA_LUT_SIZE", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_CRTC, "GAMMA_LUT_SIZE", IMMUTABLE_REQ },
> > > +
> > > + { DRM_MODE_OBJECT_PLANE, "IN_FORMATS", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_PLANE, "SIZE_HINTS", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_PLANE, "type", IMMUTABLE_REQ },
> > > + { DRM_MODE_OBJECT_PLANE, "zpos", IMMUTABLE_IF_SINGLE_VALUE },
> > > +
> > > + /* driver-specific */
> > > + { DRM_MODE_OBJECT_CONNECTOR, "hotplug_mode_update", IMMUTABLE_REQ }, // qxl, vmwgfx
> > > + { DRM_MODE_OBJECT_CONNECTOR, "implicit_placement", IMMUTABLE_REQ }, // vmwgfx
> > > + { DRM_MODE_OBJECT_PLANE, "AMD_PLANE_BLEND_LUT_SIZE", IMMUTABLE_REQ }, // amdgpu
> > > + { DRM_MODE_OBJECT_PLANE, "AMD_PLANE_DEGAMMA_LUT_SIZE", IMMUTABLE_REQ }, // amdgpu
> > > + { DRM_MODE_OBJECT_PLANE, "AMD_PLANE_LUT3D_SIZE", IMMUTABLE_REQ }, // amdgpu
> > > + { DRM_MODE_OBJECT_PLANE, "AMD_PLANE_SHAPER_LUT_SIZE", IMMUTABLE_REQ }, // amdgpu
> > > +};
>
> Not really a fan of having a list like this. All of these look
> like they are just regular immutable properties, with zpos being
> the only exception. Or is that not the case?
Hmm. I suppose it might be nice to have a "these are the standard
properites and their expected types" kind of test, to make sure no
one breaks uabi with any kernel changes. But that seems orthogonal
to the zpos problem at hand.
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2024-10-25 6:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 12:00 [PATCH i-g-t v2] tests/kms_properties: rework immutability checks Dmitry Baryshkov
2024-10-18 12:16 ` ✗ GitLab.Pipeline: warning for tests/kms_properties: rework immutability checks (rev2) Patchwork
2024-10-18 12:23 ` Dmitry Baryshkov
2024-10-18 12:27 ` ✓ CI.xeBAT: success " Patchwork
2024-10-18 12:39 ` ✓ Fi.CI.BAT: " Patchwork
2024-10-18 13:40 ` ✓ Fi.CI.IGT: " Patchwork
2024-10-19 3:09 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-24 18:29 ` [PATCH i-g-t v2] tests/kms_properties: rework immutability checks Dmitry Baryshkov
2024-10-25 5:51 ` Ville Syrjälä
2024-10-25 6:00 ` Ville Syrjälä [this message]
2024-10-25 9:53 ` Dmitry Baryshkov
2024-10-25 10:13 ` Ville Syrjälä
2024-10-25 10:26 ` Dmitry Baryshkov
2024-10-25 14:36 ` Ville Syrjälä
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=Zxs0DXIKQDtsCO4k@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=mripard@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox