Message ID | 085ed9af17e0cc45e51f6befba1cd7617a36c73a.1618299945.git.melissa.srw@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/vkms: add overlay plane support | expand |
On Tue, Apr 13, 2021 at 04:53:43AM -0300, Melissa Wen wrote: > 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. > > Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > --- > drivers/gpu/drm/vkms/vkms_composer.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c > index 66c6842d70db..be8f1d33c645 100644 > --- a/drivers/gpu/drm/vkms/vkms_composer.c > +++ b/drivers/gpu/drm/vkms/vkms_composer.c > @@ -125,26 +125,26 @@ static void blend(void *vaddr_dst, void *vaddr_src, > } > } > > -static void compose_cursor(struct vkms_composer *cursor_composer, > - struct vkms_composer *primary_composer, > +static void compose_planes(struct vkms_composer *primary_composer, > + struct vkms_composer *plane_composer, > void *vaddr_out) > { > - struct drm_gem_object *cursor_obj; > - struct drm_gem_shmem_object *cursor_shmem_obj; > + struct drm_gem_object *plane_obj; > + struct drm_gem_shmem_object *plane_shmem_obj; > > - cursor_obj = drm_gem_fb_get_obj(&cursor_composer->fb, 0); > - cursor_shmem_obj = to_drm_gem_shmem_obj(cursor_obj); > + plane_obj = drm_gem_fb_get_obj(&plane_composer->fb, 0); > + 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; > > - blend(vaddr_out, cursor_shmem_obj->vaddr, > - primary_composer, cursor_composer); > + blend(vaddr_out, plane_shmem_obj->vaddr, > + primary_composer, plane_composer); > } > > -static int compose_planes(void **vaddr_out, > - struct vkms_composer *primary_composer, > - struct vkms_composer *cursor_composer) > +static int composite(void **vaddr_out, > + struct vkms_composer *primary_composer, > + struct vkms_composer *cursor_composer) > { > struct drm_framebuffer *fb = &primary_composer->fb; > struct drm_gem_object *gem_obj = drm_gem_fb_get_obj(fb, 0); > @@ -164,7 +164,7 @@ static int compose_planes(void **vaddr_out, > memcpy(*vaddr_out, shmem_obj->vaddr, shmem_obj->base.size); > > if (cursor_composer) > - compose_cursor(cursor_composer, primary_composer, *vaddr_out); > + compose_planes(primary_composer, cursor_composer, *vaddr_out); > > return 0; > } > @@ -222,7 +222,7 @@ void vkms_composer_worker(struct work_struct *work) > if (wb_pending) > vaddr_out = crtc_state->active_writeback; > > - ret = compose_planes(&vaddr_out, primary_composer, cursor_composer); > + ret = composite(&vaddr_out, primary_composer, cursor_composer); > if (ret) { > if (ret == -EINVAL && !wb_pending) > kfree(vaddr_out); > -- > 2.30.2 >
diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index 66c6842d70db..be8f1d33c645 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -125,26 +125,26 @@ static void blend(void *vaddr_dst, void *vaddr_src, } } -static void compose_cursor(struct vkms_composer *cursor_composer, - struct vkms_composer *primary_composer, +static void compose_planes(struct vkms_composer *primary_composer, + struct vkms_composer *plane_composer, void *vaddr_out) { - struct drm_gem_object *cursor_obj; - struct drm_gem_shmem_object *cursor_shmem_obj; + struct drm_gem_object *plane_obj; + struct drm_gem_shmem_object *plane_shmem_obj; - cursor_obj = drm_gem_fb_get_obj(&cursor_composer->fb, 0); - cursor_shmem_obj = to_drm_gem_shmem_obj(cursor_obj); + plane_obj = drm_gem_fb_get_obj(&plane_composer->fb, 0); + 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; - blend(vaddr_out, cursor_shmem_obj->vaddr, - primary_composer, cursor_composer); + blend(vaddr_out, plane_shmem_obj->vaddr, + primary_composer, plane_composer); } -static int compose_planes(void **vaddr_out, - struct vkms_composer *primary_composer, - struct vkms_composer *cursor_composer) +static int composite(void **vaddr_out, + struct vkms_composer *primary_composer, + struct vkms_composer *cursor_composer) { struct drm_framebuffer *fb = &primary_composer->fb; struct drm_gem_object *gem_obj = drm_gem_fb_get_obj(fb, 0); @@ -164,7 +164,7 @@ static int compose_planes(void **vaddr_out, memcpy(*vaddr_out, shmem_obj->vaddr, shmem_obj->base.size); if (cursor_composer) - compose_cursor(cursor_composer, primary_composer, *vaddr_out); + compose_planes(primary_composer, cursor_composer, *vaddr_out); return 0; } @@ -222,7 +222,7 @@ void vkms_composer_worker(struct work_struct *work) if (wb_pending) vaddr_out = crtc_state->active_writeback; - ret = compose_planes(&vaddr_out, primary_composer, cursor_composer); + ret = composite(&vaddr_out, primary_composer, cursor_composer); if (ret) { if (ret == -EINVAL && !wb_pending) kfree(vaddr_out);
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. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> --- drivers/gpu/drm/vkms/vkms_composer.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)