From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: "Simon Ser" <contact@emersion.fr>,
intel-gfx@lists.freedesktop.org,
"Daniel Stone" <daniel@fooishbar.org>,
"Jonas Ådahl" <jadahl@redhat.com>,
dri-devel@lists.freedesktop.org,
"Harry Wentland" <harry.wentland@amd.com>
Subject: Re: [Intel-gfx] [PATCH v2 1/2] drm: Introduce plane SIZE_HINTS property
Date: Thu, 9 Feb 2023 15:10:38 +0200 [thread overview]
Message-ID: <Y+TwzhRCkFlo5U6S@intel.com> (raw)
In-Reply-To: <20230209135855.22cf1b32.pekka.paalanen@collabora.com>
On Thu, Feb 09, 2023 at 01:58:55PM +0200, Pekka Paalanen wrote:
> On Wed, 8 Feb 2023 23:10:16 +0200
> Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Add a new immutable plane property by which a plane can advertise
> > a handful of recommended plane sizes. This would be mostly exposed
> > by cursor planes as a slightly more capable replacement for
> > the DRM_CAP_CURSOR_WIDTH/HEIGHT caps, which can only declare
> > a one size fits all limit for the whole device.
> >
> > Currently eg. amdgpu/i915/nouveau just advertize the max cursor
> > size via the cursor size caps. But always using the max sized
> > cursor can waste a surprising amount of power, so a better
> > stragey is desirable.
> >
> > Most other drivers don't specify any cursor size at all, in
> > which case the ioctl code just claims that 64x64 is a great
> > choice. Whether that is actually true is debatable.
> >
> > A poll of various compositor developers informs us that
> > blindly probing with setcursor/atomic ioctl to determine
> > suitable cursor sizes is not acceptable, thus the
> > introduction of the new property to supplant the cursor
> > size caps. The compositor will now be free to select a
> > more optimal cursor size from the short list of options.
> >
> > Note that the reported sizes (either via the property or the
> > caps) make no claims about things such as plane scaling. So
> > these things should only really be consulted for simple
> > "cursor like" use cases.
> >
> > v2: Try to add some docs
> >
> > Cc: Simon Ser <contact@emersion.fr>
> > Cc: Jonas Ådahl <jadahl@redhat.com>
> > Cc: Daniel Stone <daniel@fooishbar.org>
> > Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
> > Acked-by: Harry Wentland <harry.wentland@amd.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_mode_config.c | 7 +++++
> > drivers/gpu/drm/drm_plane.c | 48 +++++++++++++++++++++++++++++++
> > include/drm/drm_mode_config.h | 5 ++++
> > include/drm/drm_plane.h | 4 +++
> > include/uapi/drm/drm_mode.h | 11 +++++++
> > 5 files changed, 75 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> > index 87eb591fe9b5..21860f94a18c 100644
> > --- a/drivers/gpu/drm/drm_mode_config.c
> > +++ b/drivers/gpu/drm/drm_mode_config.c
> > @@ -374,6 +374,13 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
> > return -ENOMEM;
> > dev->mode_config.modifiers_property = prop;
> >
> > + prop = drm_property_create(dev,
> > + DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_BLOB,
> > + "SIZE_HINTS", 0);
> > + if (!prop)
> > + return -ENOMEM;
> > + dev->mode_config.size_hints_property = prop;
> > +
> > return 0;
> > }
> >
> > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> > index 24e7998d1731..ae51b1f83755 100644
> > --- a/drivers/gpu/drm/drm_plane.c
> > +++ b/drivers/gpu/drm/drm_plane.c
> > @@ -140,6 +140,21 @@
> > * DRM_FORMAT_MOD_LINEAR. Before linux kernel release v5.1 there have been
> > * various bugs in this area with inconsistencies between the capability
> > * flag and per-plane properties.
> > + *
> > + * SIZE_HINTS:
> > + * Blob property which contains the set of recommended plane size
> > + * which can used for simple "cursor like" use cases (eg. no scaling).
> > + * Using these hints frees userspace from extensive probing of
> > + * supported plane sizes through atomic/setcursor ioctls.
> > + *
> > + * For optimal usage userspace should pick the smallest size
> > + * that satisfies its own requirements.
> > + *
> > + * The blob contains an array of struct drm_plane_size_hint.
> > + *
> > + * Drivers should only attach this property to planes that
> > + * support a very limited set of sizes (eg. cursor planes
> > + * on typical hardware).
>
> Hi Ville,
>
> sounds good. Maybe a minor nit about "typical hardware". Would e.g.
> "legacy PC hardware" be more accurate?
"legacy" doesn't feel quite right for current and upcoming hardware.
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-02-09 13:10 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 4:09 [Intel-gfx] [PATCH 0/2] drm: Add plane SIZE_HINTS property Ville Syrjala
2023-02-08 4:09 ` [Intel-gfx] [PATCH 1/2] drm: Introduce " Ville Syrjala
2023-02-08 6:09 ` kernel test robot
2023-02-08 6:09 ` kernel test robot
2023-02-08 12:13 ` Pekka Paalanen
2023-02-08 13:03 ` Ville Syrjälä
2023-02-08 21:16 ` Ville Syrjälä
2023-02-09 11:51 ` Pekka Paalanen
2023-02-14 9:42 ` Pekka Paalanen
2023-02-14 10:27 ` Ville Syrjälä
2023-02-14 11:17 ` Pekka Paalanen
2023-02-14 11:35 ` Ville Syrjälä
2023-02-08 16:51 ` Harry Wentland
2023-02-08 21:10 ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2023-02-09 11:58 ` Pekka Paalanen
2023-02-09 13:10 ` Ville Syrjälä [this message]
2023-02-10 9:44 ` Pekka Paalanen
2023-02-09 14:16 ` Jonas Ådahl
2023-02-14 9:25 ` Ville Syrjälä
2023-02-14 9:54 ` Jonas Ådahl
2023-02-14 10:28 ` Ville Syrjälä
2023-02-14 11:01 ` Jonas Ådahl
2023-02-14 11:19 ` Ville Syrjälä
2023-02-22 18:34 ` Ville Syrjälä
2023-02-14 19:27 ` Harry Wentland
2023-02-14 19:59 ` Ville Syrjälä
2023-03-13 16:33 ` [Intel-gfx] [PATCH v3 " Ville Syrjala
2023-03-17 10:34 ` Jonas Ådahl
2023-03-17 11:33 ` Ville Syrjälä
2023-03-17 12:21 ` Jonas Ådahl
2023-03-17 12:29 ` Jonas Ådahl
2023-03-17 13:15 ` Ville Syrjälä
2023-03-17 13:18 ` Jonas Ådahl
2023-03-17 13:13 ` Ville Syrjälä
2023-02-08 4:09 ` [Intel-gfx] [PATCH 2/2] drm/i915: Add SIZE_HINTS property for cursors Ville Syrjala
2023-02-08 4:50 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm: Add plane SIZE_HINTS property Patchwork
2023-02-08 5:17 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-02-08 23:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm: Add plane SIZE_HINTS property (rev2) Patchwork
2023-02-09 21:27 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-13 17:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm: Add plane SIZE_HINTS property (rev3) Patchwork
2023-03-14 21:59 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=Y+TwzhRCkFlo5U6S@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=contact@emersion.fr \
--cc=daniel@fooishbar.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jadahl@redhat.com \
--cc=pekka.paalanen@collabora.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;
as well as URLs for NNTP newsgroup(s).