backend-drm: get handle in gbm specific code

Get GBM BO handle in GBM specific code. This allows to compile
drm_output_set_cursor without GBM.

Signed-off-by: Stefan Agner <stefan@agner.ch>
dev
Stefan Agner 5 years ago
parent 5dd3e9996a
commit 974390a5fa
  1. 1
      libweston/backend-drm/drm-internal.h
  2. 1
      libweston/backend-drm/drm.c
  3. 6
      libweston/backend-drm/kms.c

@ -445,6 +445,7 @@ struct drm_output {
int disable_pending; int disable_pending;
int dpms_off_pending; int dpms_off_pending;
uint32_t gbm_cursor_handle[2];
struct drm_fb *gbm_cursor_fb[2]; struct drm_fb *gbm_cursor_fb[2];
struct drm_plane *cursor_plane; struct drm_plane *cursor_plane;
struct weston_view *cursor_view; struct weston_view *cursor_view;

@ -1307,6 +1307,7 @@ drm_output_init_cursor_egl(struct drm_output *output, struct drm_backend *b)
gbm_bo_destroy(bo); gbm_bo_destroy(bo);
goto err; goto err;
} }
output->gbm_cursor_handle[i] = gbm_bo_get_handle(bo).s32;
} }
return 0; return 0;

@ -514,8 +514,7 @@ drm_output_set_cursor(struct drm_output_state *output_state)
struct drm_backend *b = to_drm_backend(output->base.compositor); struct drm_backend *b = to_drm_backend(output->base.compositor);
struct drm_plane *plane = output->cursor_plane; struct drm_plane *plane = output->cursor_plane;
struct drm_plane_state *state; struct drm_plane_state *state;
int handle; uint32_t handle;
struct gbm_bo *bo;
if (!plane) if (!plane)
return; return;
@ -534,9 +533,8 @@ drm_output_set_cursor(struct drm_output_state *output_state)
assert(state->fb == output->gbm_cursor_fb[output->current_cursor]); assert(state->fb == output->gbm_cursor_fb[output->current_cursor]);
assert(!plane->state_cur->output || plane->state_cur->output == output); assert(!plane->state_cur->output || plane->state_cur->output == output);
handle = output->gbm_cursor_handle[output->current_cursor];
if (plane->state_cur->fb != state->fb) { if (plane->state_cur->fb != state->fb) {
bo = state->fb->bo;
handle = gbm_bo_get_handle(bo).s32;
if (drmModeSetCursor(b->drm.fd, output->crtc_id, handle, if (drmModeSetCursor(b->drm.fd, output->crtc_id, handle,
b->cursor_width, b->cursor_height)) { b->cursor_width, b->cursor_height)) {
weston_log("failed to set cursor: %s\n", weston_log("failed to set cursor: %s\n",

Loading…
Cancel
Save