Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637279
| From | Daniel Vetter <daniel@ffwll.ch> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/5] drm: Add crtc/encoder/bridge->mode_valid() callbacks |
| Date | 2017-05-08 10:00 +0200 |
| Message-ID | <tELKi-14K-3@gated-at.bofh.it> (permalink) |
| References | <tDpLP-4yP-1@gated-at.bofh.it> <tDpLQ-4yP-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, May 04, 2017 at 03:11:38PM +0100, Jose Abreu wrote:
> This adds a new callback to crtc, encoder and bridge helper functions
> called mode_valid(). This callback shall be implemented if the
> corresponding component has some sort of restriction in the modes
> that can be displayed. A NULL callback implicates that the component
> can display all the modes.
>
> Only the callbacks were implemented to simplify review process,
> following patches will make use of them.
>
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Dave Airlie <airlied@linux.ie>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> ---
> include/drm/drm_bridge.h | 20 ++++++++++++++++
> include/drm/drm_modeset_helper_vtables.h | 40 ++++++++++++++++++++++++++++++++
> 2 files changed, 60 insertions(+)
I think we should also update the kernel-doc for connector->mode_valid,
explaining why it is not called in the atomic check phase, but only at
mode probe time: To allow userspace to override the kernel's sink
checks, in case of broken EDID with wrong limits from the sink.
Otherwise lgtm.
-Daniel
>
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index fdd82fc..00c6c36 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -59,6 +59,26 @@ struct drm_bridge_funcs {
> void (*detach)(struct drm_bridge *bridge);
>
> /**
> + * @mode_valid:
> + *
> + * This callback is used to check if a specific mode is valid in this
> + * bridge. This should be implemented if the bridge has some sort of
> + * restriction in the modes it can display. For example, a given bridge
> + * may be responsible to set a clock value. If the clock can not
> + * produce all the values for the available modes then this callback
> + * can be used to restrict the number of modes to only the ones that
> + * can be displayed.
> + *
> + * This is called at mode probe and at atomic check phase.
> + *
> + * RETURNS:
> + *
> + * drm_mode_status Enum
> + */
> + enum drm_mode_status (*mode_valid)(struct drm_bridge *crtc,
> + const struct drm_display_mode *mode);
> +
> + /**
> * @mode_fixup:
> *
> * This callback is used to validate and adjust a mode. The paramater
> diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
> index c01c328..bb04688 100644
> --- a/include/drm/drm_modeset_helper_vtables.h
> +++ b/include/drm/drm_modeset_helper_vtables.h
> @@ -106,6 +106,26 @@ struct drm_crtc_helper_funcs {
> void (*commit)(struct drm_crtc *crtc);
>
> /**
> + * @mode_valid:
> + *
> + * This callback is used to check if a specific mode is valid in this
> + * crtc. This should be implemented if the crtc has some sort of
> + * restriction in the modes it can display. For example, a given crtc
> + * may be responsible to set a clock value. If the clock can not
> + * produce all the values for the available modes then this callback
> + * can be used to restrict the number of modes to only the ones that
> + * can be displayed.
> + *
> + * This is called at mode probe and at atomic check phase.
> + *
> + * RETURNS:
> + *
> + * drm_mode_status Enum
> + */
> + enum drm_mode_status (*mode_valid)(struct drm_crtc *crtc,
> + const struct drm_display_mode *mode);
> +
> + /**
> * @mode_fixup:
> *
> * This callback is used to validate a mode. The parameter mode is the
> @@ -457,6 +477,26 @@ struct drm_encoder_helper_funcs {
> void (*dpms)(struct drm_encoder *encoder, int mode);
>
> /**
> + * @mode_valid:
> + *
> + * This callback is used to check if a specific mode is valid in this
> + * encoder. This should be implemented if the encoder has some sort
> + * of restriction in the modes it can display. For example, a given
> + * encoder may be responsible to set a clock value. If the clock can
> + * not produce all the values for the available modes then this callback
> + * can be used to restrict the number of modes to only the ones that
> + * can be displayed.
> + *
> + * This is called at mode probe and at atomic check phase.
> + *
> + * RETURNS:
> + *
> + * drm_mode_status Enum
> + */
> + enum drm_mode_status (*mode_valid)(struct drm_encoder *crtc,
> + const struct drm_display_mode *mode);
> +
> + /**
> * @mode_fixup:
> *
> * This callback is used to validate and adjust a mode. The parameter
> --
> 1.9.1
>
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] Introduce new mode validation callbacks Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 16:20 +0200
[PATCH 4/5] drm: Use mode_valid() in atomic modeset Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 16:20 +0200
Re: [PATCH 4/5] drm: Use mode_valid() in atomic modeset Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-05-04 16:50 +0200
Re: [PATCH 4/5] drm: Use mode_valid() in atomic modeset Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 17:20 +0200
Re: [PATCH 4/5] drm: Use mode_valid() in atomic modeset Daniel Vetter <daniel@ffwll.ch> - 2017-05-08 10:00 +0200
[PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 16:20 +0200
Re: [PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-05-04 16:40 +0200
Re: [PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 17:00 +0200
Re: [PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Daniel Vetter <daniel@ffwll.ch> - 2017-05-08 10:00 +0200
Re: [PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-08 12:20 +0200
Re: [PATCH 2/5] drm: Use new mode_valid() helpers in connector probe helper Daniel Vetter <daniel@ffwll.ch> - 2017-05-08 20:30 +0200
[PATCH 3/5] drm: Introduce drm_bridge_mode_valid() Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 16:20 +0200
[PATCH 5/5] drm: arc: Use crtc->mode_valid() callback Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 16:20 +0200
[PATCH 1/5] drm: Add crtc/encoder/bridge->mode_valid() callbacks Jose Abreu <Jose.Abreu@synopsys.com> - 2017-05-04 16:20 +0200
Re: [PATCH 1/5] drm: Add crtc/encoder/bridge->mode_valid() callbacks Daniel Vetter <daniel@ffwll.ch> - 2017-05-08 10:00 +0200
Re: [PATCH 0/5] Introduce new mode validation callbacks Daniel Vetter <daniel@ffwll.ch> - 2017-05-08 10:00 +0200
csiph-web