Commit graph

13 commits

Author SHA1 Message Date
Miguel A. Vico 41700e355f gl-renderer: Add <platform_attribs> param to gl_renderer_display_create
This change adds <platform_attribs> parameter to
gl_renderer_display_create() in case we ever want to pass non-NULL.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
[Pekka: removed notes about EGLOutput]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-07 17:06:44 +02:00
Miguel A. Vico c095cde364 gl-renderer: Rename gl_renderer::output_create to output_window_create
No functional change. This patch renames gl_renderer_output_create() to
gl_renderer_output_window_create(), which is something more descriptive
of what the function does.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-07 17:06:01 +02:00
Miguel A. Vico dddc670c04 gl-renderer: Rename gl_renderer_create to gl_renderer_display_create
No functional change. This patch only renames gl_renderer_create() to
gl_renderer_display_create(), which is something more descriptive of
what the function does.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-07 17:05:18 +02:00
Vincent Abriou c950667e87 libweston: include weston-egl-ext.h in drm, x11 and wayland compositor
As to what is done for gl-renderer.c, weston-egl-ext.h should be
include in compositor-drm.c, compositor-x11.c and compositor-wayland.c.
This fix building issue with GPU that does not have EGL_PLATFORM_xxx_KHR
in their extension header file eglext.h.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-10-05 16:47:43 +01:00
Armin Krezović 4008740d5e weston: Rename weston_output_init_pending() to weston_output_init()
v2:

 - Rebased for latest changes.

v3:

 - Rebased for changes in wayland backend.

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
2016-10-05 14:59:09 +03:00
Armin Krezović 083681325b weston: Port DRM backend to new output handling API
This is a complete port of the DRM backend that uses
the recently added output handling API for output
configuration.

Output can be configured at runtime by passing the
necessary configuration parameters, which can be
filled in manually or obtained from the configuration
file using previously added functionality. It is
required that the scale and transform values are set
using the previously added functionality.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

v2:

 - Added missing drmModeFreeCrtc() to drm_output_enable()
   cleanup list in case of failure.
 - Split drm_backend_disable() into drm_backend_deinit()
   to accomodate for changes in the first patch in the
   series. Moved restoring original crtc to
   drm_output_destroy().

v3:

 - Moved origcrtc allocation to drm_output_set_mode().
 - Swapped connector_get_current_mode() and
   drm_output_add_mode() calls in drm_output_set_mode()
   to match current weston.
 - Moved crtc_allocator and connector_allocator update
   from drm_output_enable() to create_output_for_connector()
   to avoid problems when more than one monitor is connected
   at startup and crtc allocator wasn't updated before
   create_output_for_connector() was called second time,
   resulting in one screen being turned off.
 - Moved crtc_allocator and connector_allocator update from
   drm_output_deinit() to drm_output_destroy(), as it
   should not be called on drm_output_disable().
 - Use weston_compositor_add_pending_output().
 - Bump weston_drm_backend_config version to 2.

v4:

 - Reset output->original_crtc to NULL if drm_output_set_mode()
   fails.
 - Remove unneeded log message when disabling an output when a
   pageflip is pending.
 - Document that create_output_for_connector() takes ownership
   of the connector.
 - Free the connector if create output conditionals are not met
   in create_outputs() and update_outputs().

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-10-03 14:22:50 +03:00
Yong Bakos 4b6321f49a
compositor-drm: Zero drmModeAddFB2 data
Initialize arrays of data passed to drmModeAddFB2, just as
drm_fb_get_from_bo does.

See https://lists.freedesktop.org/archives/wayland-devel/2016-August/030645.html

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-08-18 10:28:35 +02:00
Derek Foreman 482ffdf006
compositor-drm: Stop sending uninit data to the kernel
Valgrind noticed that we send uninit data to drmModeAddFB2.  While
the kernel should never read this (because of the plane format),
it's probably still nicer to zero the data before we send it.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-08-15 17:35:42 +02:00
Armin Krezović 545dba6fda compositor-drm: Use non-cast functions to retrieve backend and output objects
This uses container_of instead of explicit cast to retrieve
backend and output objects from generic weston_backend and
weston_output pointers.

v2:

- Remove unneeded cast
- Remove unneeded line breaks

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-08-08 14:48:51 +03:00
Armin Krezović 984781f302 compositor-drm: Do not exit when there are no outputs left
When there are no outputs left after a hotplug event, weston
will terminate. This isn't desired when trying to get weston
to work with zero outputs.

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-08-05 15:14:07 +03:00
Armin Krezović b12a754259 compositor-drm: Do not return an error when no connectors are configured
Returning an error when there are no connectors results in
weston terminating after that. That's not expected when
trying to get weston to start with zero drm outputs.

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-08-05 15:14:07 +03:00
Jussi Kukkonen 649bbce607 include stdint.h for int32_t/uint32_t
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-26 16:26:08 -07:00
Pekka Paalanen b5e3ea218b Rename src/ to libweston/
This clarifies what is supposed to be the libweston code.

v2: screen-share.c is already in compositor/ instead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
2016-06-23 17:44:54 +03:00
Renamed from src/compositor-drm.c (Browse further)