drm/virtio: add plane check
Use drm_atomic_helper_check_plane_state() to sanity check the plane state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Chia-I Wu <olvaffe@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20190822094657.27483-1-kraxel@redhat.com
This commit is contained in:
Родитель
66c2dee4ae
Коммит
a02c4c25b9
|
@ -84,7 +84,22 @@ static const struct drm_plane_funcs virtio_gpu_plane_funcs = {
|
||||||
static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
|
static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
|
||||||
struct drm_plane_state *state)
|
struct drm_plane_state *state)
|
||||||
{
|
{
|
||||||
return 0;
|
bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR;
|
||||||
|
struct drm_crtc_state *crtc_state;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!state->fb || !state->crtc)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
|
||||||
|
if (IS_ERR(crtc_state))
|
||||||
|
return PTR_ERR(crtc_state);
|
||||||
|
|
||||||
|
ret = drm_atomic_helper_check_plane_state(state, crtc_state,
|
||||||
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
|
is_cursor, true);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
|
static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче