[PATCH weston v6 09/12] drm: Move drm's output configuration into the drm backend

Pekka Paalanen ppaalanen at gmail.com
Mon Apr 18 10:30:22 UTC 2016


On Sun, 17 Apr 2016 13:26:58 +0300
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:

> Hi,
> 
> I don't understand this one at all, you're moving configuration back
> into the backend, partially reverting patch 5.
> 

Hi,

indeed, the very reason we are working on this patch series is to take
all .ini file parsing, struct weston_config, and command line parsing
out from the backends and libweston.

That is also why we need the configure_output callback for now, to let
main.c handle configuring outputs that were not explicitly mentioned in
configuration.

I'm with Giulio here.


Thanks,
pq

> 2016-04-16 6:28 GMT+03:00 Bryce Harrington <bryce at osg.samsung.com>:
> > Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> > ---
> >  src/compositor-drm.c | 93 ++++++++++++++++++++++++++++++++++++++++++++--------
> >  src/compositor-drm.h | 41 -----------------------
> >  src/main.c           | 43 ------------------------
> >  3 files changed, 80 insertions(+), 97 deletions(-)
> >
> > diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> > index 6ef706a..d129adc 100644
> > --- a/src/compositor-drm.c
> > +++ b/src/compositor-drm.c
> > @@ -75,6 +75,41 @@
> >  #define GBM_BO_USE_CURSOR GBM_BO_USE_CURSOR_64X64
> >  #endif
> >
> > +enum weston_drm_backend_output_mode {
> > +       /** The output is disabled */
> > +       WESTON_DRM_BACKEND_OUTPUT_OFF,
> > +
> > +       /** The output will use the current active mode */
> > +       WESTON_DRM_BACKEND_OUTPUT_CURRENT,
> > +
> > +       /** The output will use the preferred mode. A modeline can be provided
> > +        * by setting weston_backend_output_config::modeline in the form of
> > +        * "WIDTHxHEIGHT" or in the form of an explicit modeline calculated
> > +        * using e.g. the cvt tool. If a valid modeline is supplied it will be
> > +        * used, if invalid or NULL the preferred available mode will be used. */
> > +       WESTON_DRM_BACKEND_OUTPUT_PREFERRED,
> > +};
> > +
> > +struct weston_drm_backend_output_config {
> > +       struct weston_backend_output_config base;
> > +
> > +       /** The pixel format to be used by the output. Valid values are:
> > +        * - NULL - The format set at backend creation time will be used
> > +        * - "xrgb8888"
> > +        * - "rgb565"
> > +        * - "xrgb2101010"
> > +        */
> > +       char *gbm_format;
> > +
> > +       /** The seat to be used by the output. Set to NULL to use the
> > +        * default seat. */
> > +       char *seat;
> > +
> > +       /** The modeline to be used by the output. Refer to the documentation
> > +        * of WESTON_DRM_BACKEND_OUTPUT_PREFERRED for details. */
> > +       char *modeline;
> > +};
> > +
> >  struct drm_backend {
> >         struct weston_backend base;
> >         struct weston_compositor *compositor;
> > @@ -121,16 +156,6 @@ struct drm_backend {
> >         int32_t cursor_width;
> >         int32_t cursor_height;
> >
> > -        /** Callback used to configure the outputs.
> > -        *
> > -         * This function will be called by the backend when a new DRM
> > -         * output needs to be configured.
> > -         */
> > -        enum weston_drm_backend_output_mode
> > -       (*configure_output)(struct weston_compositor *compositor,
> > -                           bool use_current_mode,
> > -                           const char *name,
> > -                           struct weston_drm_backend_output_config *output_config);
> >         bool use_current_mode;
> >  };
> >
> > @@ -2275,6 +2300,49 @@ connector_get_current_mode(drmModeConnector *connector, int drm_fd,
> >         return 0;
> >  }
> >
> > +static enum weston_drm_backend_output_mode
> > +drm_configure_output(struct weston_compositor *c,
> > +                     bool use_current_mode,
> > +                     const char *name,
> > +                     struct weston_drm_backend_output_config *config)
> > +{
> > +       struct weston_config *wc = weston_compositor_get_user_data(c);  
> 
> This is wrong, you're assuming the user data is a weston_config, which
> won't be true for non-weston compositors.
> 
> Sorry, but NAK from me.
> 
> 
> Giulio

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160418/0b050785/attachment.sig>


More information about the wayland-devel mailing list