On Tue, Aug 23, 2016 at 5:20 PM, Daniel Vetter <daniel@xxxxxxxx> wrote:
On Tue, Aug 23, 2016 at 04:08:04PM +0200, Andrea Merello wrote:
> Introduce drm_simple_display_pipe_attach_bridge() in order Threading of your patch series is somehow broken, usually that should all
> to make it possible to use drm encoders with the simple display
> pipes managed by simple_kms_helpers
>
> Suggested-by: Daniel Vetter <daniel@xxxxxxxx>
> Signed-off-by: Andrea Merello <andrea.merello@xxxxxxxxx>
> Cc: Noralf Trønnes <noralf@xxxxxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
work nicely if you've set up git send-email.
One question: Should we ahve a drm_simple_display_pipe_detach_bridge (for
cleanup) too?
Unsure if it worths. May be nice to have a balanced pair, but it would probably end up in
a quite redundant one-line func, that only calls drm_bridge_detach with the very same argument.
..But of course if you want I can add it in v2 series.
(ACK for all other things)
(ACK for all other things)
Andrea
-Daniel
--
>
> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_ kms_helper.c
> index 3a48c7c..05ee61d 100644
> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
> @@ -133,6 +133,28 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = {
> };
>
> /**
> + * drm_simple_display_pipe_attach_bridge - Attach a bridge to the display pipe
> + * @pipe: simple display pipe object
> + * @bridge: bridge to attach
> + *
> + * Makes it possible to still use the drm_simple_display_pipe helpers when
> + * a DRM bridge has to be used.
> + * Note that you probably want to initialize the pipe by passing a NULL
> + * connector to drm_simple_display_pipe_init()
> + *
> + * Returns:
> + * Zero on success, negative error code on failure.
> + */
> +int drm_simple_display_pipe_attach_bridge(struct drm_simple_display_pipe *pipe,
> + struct drm_bridge *bridge)
> +{
> + bridge->encoder = &pipe->encoder;
> + pipe->encoder.bridge = bridge;
> + return drm_bridge_attach(pipe->encoder.dev, bridge);
> +}
> +EXPORT_SYMBOL(drm_simple_display_pipe_attach_bridge);
> +
> +/**
> * drm_simple_display_pipe_init - Initialize a simple display pipeline
> * @dev: DRM device
> * @pipe: simple display pipe object to initialize
> diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_ helper.h
> index 2690397..1d73bcf 100644
> --- a/include/drm/drm_simple_kms_helper.h
> +++ b/include/drm/drm_simple_kms_helper.h
> @@ -85,6 +85,9 @@ struct drm_simple_display_pipe {
> const struct drm_simple_display_pipe_funcs *funcs;
> };
>
> +int drm_simple_display_pipe_attach_bridge(struct drm_simple_display_pipe *pipe,
> + struct drm_bridge *bridge);
> +
> int drm_simple_display_pipe_init(struct drm_device *dev,
> struct drm_simple_display_pipe *pipe,
> const struct drm_simple_display_pipe_funcs *funcs,
> --
> 2.7.4
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel