From: Sam Ravnborg <sam@ravnborg.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 18/21] drm: Unexport primary plane helpers
Date: Thu, 4 Oct 2018 23:14:44 +0200 [thread overview]
Message-ID: <20181004211444.GC24507@ravnborg.org> (raw)
In-Reply-To: <20181004202446.22905-19-daniel.vetter@ffwll.ch>
Hi Daniel.
On Thu, Oct 04, 2018 at 10:24:43PM +0200, Daniel Vetter wrote:
> Well except the destroy helper, which isn't really a primary helper
> but generally useful, if mislabelled.
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/gpu/drm/drm_plane_helper.c | 85 ++++--------------------------
> include/drm/drm_plane_helper.h | 10 ----
> 2 files changed, 11 insertions(+), 84 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
> index 33b3e6892787..0fff72dcd06d 100644
> --- a/drivers/gpu/drm/drm_plane_helper.c
> +++ b/drivers/gpu/drm/drm_plane_helper.c
> @@ -42,11 +42,8 @@
> * primary plane support on top of the normal CRTC configuration interface.
> * Since the legacy &drm_mode_config_funcs.set_config interface ties the primary
> * plane together with the CRTC state this does not allow userspace to disable
> - * the primary plane itself. To avoid too much duplicated code use
> - * drm_plane_helper_check_update() which can be used to enforce the same
> - * restrictions as primary planes had thus. The default primary plane only
> - * expose XRBG8888 and ARGB8888 as valid pixel formats for the attached
> - * framebuffer.
> + * the primary plane itself. The default primary plane only expose XRBG8888 and
> + * ARGB8888 as valid pixel formats for the attached framebuffer.
> *
> * Drivers are highly recommended to implement proper support for primary
> * planes, and newly merged drivers must not rely upon these transitional
> @@ -148,50 +145,13 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,
> return 0;
> }
>
> -/**
> - * drm_primary_helper_update() - Helper for primary plane update
> - * @plane: plane object to update
> - * @crtc: owning CRTC of owning plane
> - * @fb: framebuffer to flip onto plane
> - * @crtc_x: x offset of primary plane on crtc
> - * @crtc_y: y offset of primary plane on crtc
> - * @crtc_w: width of primary plane rectangle on crtc
> - * @crtc_h: height of primary plane rectangle on crtc
> - * @src_x: x offset of @fb for panning
> - * @src_y: y offset of @fb for panning
> - * @src_w: width of source rectangle in @fb
> - * @src_h: height of source rectangle in @fb
> - * @ctx: lock acquire context, not used here
> - *
> - * Provides a default plane update handler for primary planes. This is handler
> - * is called in response to a userspace SetPlane operation on the plane with a
> - * non-NULL framebuffer. We call the driver's modeset handler to update the
> - * framebuffer.
> - *
> - * SetPlane() on a primary plane of a disabled CRTC is not supported, and will
> - * return an error.
> - *
> - * Note that we make some assumptions about hardware limitations that may not be
> - * true for all hardware --
> - *
> - * 1. Primary plane cannot be repositioned.
> - * 2. Primary plane cannot be scaled.
> - * 3. Primary plane must cover the entire CRTC.
> - * 4. Subpixel positioning is not supported.
> - *
> - * Drivers for hardware that don't have these restrictions can provide their
> - * own implementation rather than using this helper.
> - *
> - * RETURNS:
> - * Zero on success, error code on failure
> - */
> -int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
> - struct drm_framebuffer *fb,
> - int crtc_x, int crtc_y,
> - unsigned int crtc_w, unsigned int crtc_h,
> - uint32_t src_x, uint32_t src_y,
> - uint32_t src_w, uint32_t src_h,
> - struct drm_modeset_acquire_ctx *ctx)
> +static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
This looks like a useful comment explaining the purpose
of a function get lost.
> + struct drm_framebuffer *fb,
> + int crtc_x, int crtc_y,
> + unsigned int crtc_w, unsigned int crtc_h,
> + uint32_t src_x, uint32_t src_y,
> + uint32_t src_w, uint32_t src_h,
> + struct drm_modeset_acquire_ctx *ctx)
> {
> struct drm_mode_set set = {
> .crtc = crtc,
> @@ -258,35 +218,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
> kfree(connector_list);
> return ret;
> }
> -EXPORT_SYMBOL(drm_primary_helper_update);
>
> -/**
> - * drm_primary_helper_disable() - Helper for primary plane disable
> - * @plane: plane to disable
> - * @ctx: lock acquire context, not used here
> - *
> - * Provides a default plane disable handler for primary planes. This is handler
> - * is called in response to a userspace SetPlane operation on the plane with a
> - * NULL framebuffer parameter. It unconditionally fails the disable call with
> - * -EINVAL the only way to disable the primary plane without driver support is
> - * to disable the entire CRTC. Which does not match the plane
> - * &drm_plane_funcs.disable_plane hook.
> - *
> - * Note that some hardware may be able to disable the primary plane without
> - * disabling the whole CRTC. Drivers for such hardware should provide their
> - * own disable handler that disables just the primary plane (and they'll likely
> - * need to provide their own update handler as well to properly re-enable a
> - * disabled primary plane).
> - *
> - * RETURNS:
> - * Unconditionally returns -EINVAL.
> - */
> -int drm_primary_helper_disable(struct drm_plane *plane,
> - struct drm_modeset_acquire_ctx *ctx)
> +static int drm_primary_helper_disable(struct drm_plane *plane,
> + struct drm_modeset_acquire_ctx *ctx)
> {
> return -EINVAL;
> }
Likewise, good comment deleted. But then in this case this is also
nicely commented where disable_plane is called.
The single use of disable_plane could also just check for NULL,
that would be more straightforward and then this functions could be deleted.
Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-10-04 21:14 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 20:24 [PATCH 00/21] atomic helper cleanup, take 2 Daniel Vetter
2018-10-04 20:24 ` [PATCH 01/21] drm/amdgpu: Remove default best_encoder hook from DC Daniel Vetter
2018-10-05 15:41 ` Harry Wentland
2018-10-05 20:13 ` Leo Li
2018-10-04 20:24 ` [PATCH 02/21] drm/atomic-helper: Unexport drm_atomic_helper_best_encoder Daniel Vetter
2018-10-04 20:24 ` [PATCH 03/21] drm: Extract drm_atomic_state_helper.[hc] Daniel Vetter
2018-10-04 20:24 ` [PATCH 04/21] drm/vmwgfx: Don't look at state->allow_modeset Daniel Vetter
2018-10-04 20:24 ` [PATCH 05/21] drm/vmwgfx: Remove confused comment from vmw_du_connector_atomic_set_property Daniel Vetter
2018-10-04 22:40 ` Thomas Hellstrom
2018-10-05 6:43 ` Daniel Vetter
2018-10-05 7:48 ` Daniel Vetter
2018-10-05 18:19 ` Thomas Hellstrom
2018-10-05 18:30 ` Daniel Vetter
2018-10-04 20:24 ` [PATCH 06/21] drm/atomic: Improve docs for drm_atomic_state->allow_modeset Daniel Vetter
2018-10-04 20:24 ` [PATCH 07/21] drm/vmwgfx: Add FIXME comments for customer page_flip handlers Daniel Vetter
2018-10-04 20:24 ` [PATCH 08/21] drm/arcpgu: Drop transitional hooks Daniel Vetter
2018-10-04 20:24 ` [PATCH 09/21] drm/atmel: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 10/21] drm/arcpgu: Use drm_atomic_helper_shutdown Daniel Vetter
[not found] ` <20181004202446.22905-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2018-10-04 20:24 ` [PATCH 11/21] drm/msm: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 12/21] drm/sti: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 13/21] drm/vc4: " Daniel Vetter
2018-10-04 20:24 ` [PATCH 14/21] drm/zte: " Daniel Vetter
2018-10-05 13:07 ` Shawn Guo
2018-10-04 20:24 ` [PATCH 15/21] drm: Remove transitional helpers Daniel Vetter
2018-10-04 21:04 ` Sam Ravnborg
2018-10-05 6:10 ` Daniel Vetter
2018-10-04 20:24 ` [PATCH 16/21] drm/vmwgfx: Fix vmw_du_cursor_plane_atomic_check Daniel Vetter
2018-10-05 16:06 ` Daniel Vetter
2018-10-05 16:21 ` Thomas Hellstrom
2018-10-05 20:46 ` Daniel Vetter
2018-10-05 20:53 ` Thomas Hellstrom
2018-10-04 20:24 ` [PATCH 17/21] drm: Unexport drm_plane_helper_check_update Daniel Vetter
2018-10-04 21:03 ` Sam Ravnborg
2018-10-05 6:13 ` Daniel Vetter
2018-10-04 20:24 ` [PATCH 18/21] drm: Unexport primary plane helpers Daniel Vetter
2018-10-04 21:14 ` Sam Ravnborg [this message]
2018-10-05 6:18 ` Daniel Vetter
2018-10-05 9:47 ` [PATCH] " Daniel Vetter
2018-10-04 20:24 ` [PATCH 19/21] drm/doc: fix drm_driver_legacy_fb_format Daniel Vetter
2018-10-05 5:07 ` Gerd Hoffmann
2018-10-04 20:24 ` [PATCH 20/21] drm/todo: Add some cleanup tasks Daniel Vetter
2018-10-04 20:35 ` Ville Syrjälä
2018-10-05 16:07 ` Harry Wentland
2018-10-05 16:20 ` Eric Engestrom
2018-10-04 20:24 ` [PATCH 21/21] drm/doc: kerneldoc for quirk_addfb_prefer_xbgr_30bpp Daniel Vetter
2018-10-24 10:01 ` Alexandru-Cosmin Gheorghe
2018-10-24 12:19 ` Daniel Vetter
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=20181004211444.GC24507@ravnborg.org \
--to=sam@ravnborg.org \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.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