mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 09:58:14 +02:00
backend-drm: Rename sprites with hardware planes
Perhaps this would make things a bit more obvious to newcomers not being familiar with historical 2D bitmap hardware sprite. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
dde648a25f
commit
c66d0ea09a
4 changed files with 17 additions and 16 deletions
|
|
@ -222,7 +222,7 @@ struct drm_device {
|
|||
int32_t cursor_height;
|
||||
|
||||
bool cursors_are_broken;
|
||||
bool sprites_are_broken;
|
||||
bool disable_client_buffer_scanout;
|
||||
|
||||
void *repaint_data;
|
||||
|
||||
|
|
|
|||
|
|
@ -1560,16 +1560,16 @@ drm_plane_create_handle(struct drm_plane *plane, struct drm_output *output)
|
|||
}
|
||||
|
||||
/**
|
||||
* Initialise sprites (overlay planes)
|
||||
* Initialise hardware planes
|
||||
*
|
||||
* Walk the list of provided DRM planes, and add overlay planes.
|
||||
*
|
||||
* Call destroy_sprites to free these planes.
|
||||
* Call destroy_planes to free these planes.
|
||||
*
|
||||
* @param device DRM device
|
||||
*/
|
||||
static void
|
||||
create_sprites(struct drm_device *device)
|
||||
create_planes(struct drm_device *device)
|
||||
{
|
||||
drmModePlaneRes *kplane_res;
|
||||
drmModePlane *kplane;
|
||||
|
|
@ -1601,14 +1601,14 @@ create_sprites(struct drm_device *device)
|
|||
}
|
||||
|
||||
/**
|
||||
* Clean up sprites (overlay planes)
|
||||
* Clean up hardware planes
|
||||
*
|
||||
* The counterpart to create_sprites.
|
||||
* The counterpart to create_planes.
|
||||
*
|
||||
* @param device DRM device
|
||||
*/
|
||||
static void
|
||||
destroy_sprites(struct drm_device *device)
|
||||
destroy_planes(struct drm_device *device)
|
||||
{
|
||||
struct drm_plane *plane, *next;
|
||||
|
||||
|
|
@ -4016,7 +4016,7 @@ drm_shutdown(struct weston_backend *backend)
|
|||
wl_event_source_remove(b->perf_page_flips_stats.pageflip_timer_counter);
|
||||
|
||||
/* We are shutting down. This function destroy the planes with
|
||||
* destroy_sprites() and then calls weston_compositor_shutdown(), which
|
||||
* destroy_planes() and then calls weston_compositor_shutdown(), which
|
||||
* will lead to calls to drm_output_destroy(). We are destroying the
|
||||
* plane and its state_cur in drm_plane_destroy(), and that removes
|
||||
* state_cur from the output->state_cur list, but not from the
|
||||
|
|
@ -4031,7 +4031,7 @@ drm_shutdown(struct weston_backend *backend)
|
|||
*
|
||||
* But now we don't leak the drm_output during shutdown with a pending
|
||||
* flip anymore. So we must destroy output->state_last for every output
|
||||
* before destroying the planes with destroy_sprites(), otherwise we'd
|
||||
* before destroying the planes with destroy_planes(), otherwise we'd
|
||||
* leave output->state_last referring to a freed plane, leading to
|
||||
* issues when trying to free it at a later point.
|
||||
*/
|
||||
|
|
@ -4068,7 +4068,7 @@ drm_device_destroy(struct drm_device *device)
|
|||
|
||||
wl_list_remove(&device->link);
|
||||
|
||||
destroy_sprites(device);
|
||||
destroy_planes(device);
|
||||
|
||||
wl_list_for_each_safe(crtc, crtc_tmp, &device->crtc_list, link)
|
||||
drm_crtc_destroy(crtc);
|
||||
|
|
@ -4363,9 +4363,9 @@ planes_binding(struct weston_keyboard *keyboard, const struct timespec *time,
|
|||
device->cursors_are_broken ^= true;
|
||||
break;
|
||||
case KEY_V:
|
||||
/* We don't support overlay-plane usage with legacy KMS. */
|
||||
/* We don't support hardware planes usage with legacy KMS. */
|
||||
if (device->atomic_modeset)
|
||||
device->sprites_are_broken ^= true;
|
||||
device->disable_client_buffer_scanout ^= true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -4421,7 +4421,7 @@ drm_device_create(struct drm_backend *backend,
|
|||
WL_EVENT_READABLE, on_drm_input, device);
|
||||
|
||||
wl_list_init(&device->plane_list);
|
||||
create_sprites(device);
|
||||
create_planes(device);
|
||||
|
||||
wl_list_init(&device->drm_colorop_3x1d_lut_list);
|
||||
|
||||
|
|
|
|||
|
|
@ -2080,7 +2080,7 @@ init_kms_caps(struct drm_device *device)
|
|||
* enabled.
|
||||
*/
|
||||
if (!device->atomic_modeset || getenv("WESTON_FORCE_RENDERER"))
|
||||
device->sprites_are_broken = true;
|
||||
device->disable_client_buffer_scanout = true;
|
||||
|
||||
ret = drmSetClientCap(device->kms_device->fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1);
|
||||
device->aspect_ratio_supported = (ret == 0);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ drm_output_try_paint_node_on_plane(struct drm_plane_handle *handle,
|
|||
struct drm_plane *plane = handle->plane;
|
||||
struct drm_plane_state *state = NULL;
|
||||
|
||||
assert(!device->sprites_are_broken);
|
||||
assert(!device->disable_client_buffer_scanout);
|
||||
assert(output == handle->output);
|
||||
assert(device->atomic_modeset);
|
||||
assert(fb);
|
||||
|
|
@ -1293,7 +1293,8 @@ drm_assign_planes(struct weston_output *output_base)
|
|||
drm_debug(b, "\t[repaint] preparing state for output %s (%lu)\n",
|
||||
output_base->name, (unsigned long) output_base->id);
|
||||
|
||||
if (!device->sprites_are_broken && !output_base->disable_planes &&
|
||||
if (!device->disable_client_buffer_scanout &&
|
||||
!output_base->disable_planes &&
|
||||
!output->is_virtual && b->gbm) {
|
||||
drm_debug(b, "\t[repaint] trying planes-only build state\n");
|
||||
state = drm_output_propose_state(output_base, pending_state, mode);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue