diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2019-01-09 12:26:07 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2019-01-23 16:28:26 +0200 |
commit | 1ca025cc5d76a3cc53bcd73bfdc4f18fc7e46df1 (patch) | |
tree | ddf48d9bcd8c94c5aede01edea7532f9f2dca27f /libweston | |
parent | 2ce2339045688dccbae98bd8aa8f4647e880ed04 (diff) | |
download | weston-1ca025cc5d76a3cc53bcd73bfdc4f18fc7e46df1.tar.gz |
compositor-drm: Display the pixel format of the framebuffer used by the plane
With this patch we also display the format in usage by the HW-plane.
This touches both legacy and atomic paths.
Diffstat (limited to 'libweston')
-rw-r--r-- | libweston/compositor-drm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 8eaa92e7..5102bb14 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -2219,6 +2219,7 @@ drm_output_apply_state_legacy(struct drm_output_state *state) struct drm_plane_state *ps; struct drm_mode *mode; struct drm_head *head; + const struct pixel_format_info *pinfo = NULL; uint32_t connectors[MAX_CLONED_CONNECTORS]; int n_conn = 0; struct timespec now; @@ -2298,6 +2299,7 @@ drm_output_apply_state_legacy(struct drm_output_state *state) !scanout_plane->state_cur->fb || scanout_plane->state_cur->fb->strides[0] != scanout_state->fb->strides[0]) { + ret = drmModeSetCrtc(backend->drm.fd, output->crtc_id, scanout_state->fb->fb_id, 0, 0, @@ -2309,6 +2311,11 @@ drm_output_apply_state_legacy(struct drm_output_state *state) } } + pinfo = scanout_state->fb->format; + drm_debug(backend, "\t[CRTC:%u, PLANE:%u] FORMAT: %s\n", + output->crtc_id, scanout_state->plane->plane_id, + pinfo ? pinfo->drm_format_name : "UNKNOWN"); + if (drmModePageFlip(backend->drm.fd, output->crtc_id, scanout_state->fb->fb_id, DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { @@ -2531,6 +2538,7 @@ drm_output_apply_state_atomic(struct drm_output_state *state, wl_list_for_each(plane_state, &state->plane_list, link) { struct drm_plane *plane = plane_state->plane; + const struct pixel_format_info *pinfo = NULL; ret |= plane_add_prop(req, plane, WDRM_PLANE_FB_ID, plane_state->fb ? plane_state->fb->fb_id : 0); @@ -2553,6 +2561,13 @@ drm_output_apply_state_atomic(struct drm_output_state *state, ret |= plane_add_prop(req, plane, WDRM_PLANE_CRTC_H, plane_state->dest_h); + if (plane_state->fb && plane_state->fb->format) + pinfo = plane_state->fb->format; + + drm_debug(plane->backend, "\t\t\t[PLANE:%lu] FORMAT: %s\n", + (unsigned long) plane->plane_id, + pinfo ? pinfo->drm_format_name : "UNKNOWN"); + if (ret != 0) { weston_log("couldn't set plane state\n"); return ret; |