diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-12-10 09:49:02 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-12-11 17:02:16 +0100 |
commit | 230b8b04d74958ebc5892510475e510b1284f14f (patch) | |
tree | 2e052d6731ca4d9c9f6f03e5fbefb74d94e1ee0b /drivers/gpu/drm/udl/udl_modeset.c | |
parent | d8177841aa8a5d32767a5a18413c30b40234a4e5 (diff) | |
download | linux-230b8b04d74958ebc5892510475e510b1284f14f.tar.bz2 |
drm/udl: Convert to drm_atomic_helper_dirtyfb()
The infrastruture for atomic modesetting allows us to use the generic
code for dirty-FB and damage handling. Switch over udl and remove the
driver's implementation. The simple-pipe's update function now picks up
the primary plane's damage and updates a minimal region of the screen.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084905.5570-7-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/udl/udl_modeset.c')
-rw-r--r-- | drivers/gpu/drm/udl/udl_modeset.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 067f626bb65b..c02e383afabe 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -11,6 +11,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_damage_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_modeset_helper_vtables.h> #include <drm/drm_vblank.h> @@ -332,7 +333,9 @@ udl_simple_display_pipe_update(struct drm_simple_display_pipe *pipe, { struct drm_device *dev = pipe->crtc.dev; struct udl_device *udl = dev->dev_private; - struct drm_framebuffer *fb = pipe->plane.state->fb; + struct drm_plane_state *state = pipe->plane.state; + struct drm_framebuffer *fb = state->fb; + struct drm_rect rect; spin_lock(&udl->active_fb_16_lock); udl->active_fb_16 = fb; @@ -341,7 +344,9 @@ udl_simple_display_pipe_update(struct drm_simple_display_pipe *pipe, if (!fb) return; - udl_handle_damage(fb, 0, 0, fb->width, fb->height); + if (drm_atomic_helper_damage_merged(old_plane_state, state, &rect)) + udl_handle_damage(fb, rect.x1, rect.y1, rect.x2 - rect.x1, + rect.y2 - rect.y1); } static const @@ -359,7 +364,7 @@ struct drm_simple_display_pipe_funcs udl_simple_display_pipe_funcs = { */ static const struct drm_mode_config_funcs udl_mode_funcs = { - .fb_create = udl_fb_user_fb_create, + .fb_create = drm_gem_fb_create_with_dirty, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, }; |