Commit cac80e71 authored by Melissa Wen's avatar Melissa Wen

drm/vkms: rename cursor to plane on ops of planes composition

Generalize variables and function names used for planes composition
(from cursor to plane), since we will reuse the operations for both
cursor and overlay types.

No functional change.

v4:
- use better names for functions of plane composition (Daniel)
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/ef3249c9ac3a08b7079894f9f1ccf70960194ec7.1619250933.git.melissa.srw@gmail.com
parent 2f56dd8c
...@@ -125,24 +125,24 @@ static void blend(void *vaddr_dst, void *vaddr_src, ...@@ -125,24 +125,24 @@ static void blend(void *vaddr_dst, void *vaddr_src,
} }
} }
static void compose_cursor(struct vkms_composer *cursor_composer, static void compose_plane(struct vkms_composer *primary_composer,
struct vkms_composer *primary_composer, struct vkms_composer *plane_composer,
void *vaddr_out) void *vaddr_out)
{ {
struct drm_gem_object *cursor_obj; struct drm_gem_object *plane_obj;
struct drm_gem_shmem_object *cursor_shmem_obj; struct drm_gem_shmem_object *plane_shmem_obj;
cursor_obj = drm_gem_fb_get_obj(&cursor_composer->fb, 0); plane_obj = drm_gem_fb_get_obj(&plane_composer->fb, 0);
cursor_shmem_obj = to_drm_gem_shmem_obj(cursor_obj); plane_shmem_obj = to_drm_gem_shmem_obj(plane_obj);
if (WARN_ON(!cursor_shmem_obj->vaddr)) if (WARN_ON(!plane_shmem_obj->vaddr))
return; return;
blend(vaddr_out, cursor_shmem_obj->vaddr, blend(vaddr_out, plane_shmem_obj->vaddr,
primary_composer, cursor_composer); primary_composer, plane_composer);
} }
static int compose_planes(void **vaddr_out, static int compose_active_planes(void **vaddr_out,
struct vkms_composer *primary_composer, struct vkms_composer *primary_composer,
struct vkms_composer *cursor_composer) struct vkms_composer *cursor_composer)
{ {
...@@ -164,7 +164,7 @@ static int compose_planes(void **vaddr_out, ...@@ -164,7 +164,7 @@ static int compose_planes(void **vaddr_out,
memcpy(*vaddr_out, shmem_obj->vaddr, shmem_obj->base.size); memcpy(*vaddr_out, shmem_obj->vaddr, shmem_obj->base.size);
if (cursor_composer) if (cursor_composer)
compose_cursor(cursor_composer, primary_composer, *vaddr_out); compose_plane(primary_composer, cursor_composer, *vaddr_out);
return 0; return 0;
} }
...@@ -222,7 +222,8 @@ void vkms_composer_worker(struct work_struct *work) ...@@ -222,7 +222,8 @@ void vkms_composer_worker(struct work_struct *work)
if (wb_pending) if (wb_pending)
vaddr_out = crtc_state->active_writeback; vaddr_out = crtc_state->active_writeback;
ret = compose_planes(&vaddr_out, primary_composer, cursor_composer); ret = compose_active_planes(&vaddr_out, primary_composer,
cursor_composer);
if (ret) { if (ret) {
if (ret == -EINVAL && !wb_pending) if (ret == -EINVAL && !wb_pending)
kfree(vaddr_out); kfree(vaddr_out);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment