diff options
| author | Ville Syrjälä <[email protected]> | 2018-03-23 15:35:09 +0000 |
|---|---|---|
| committer | Ville Syrjälä <[email protected]> | 2018-03-28 16:19:32 +0000 |
| commit | e85d30060eddccfcfbf7fdbd61a23cfbda05cc59 (patch) | |
| tree | 01d01405b2a6e6ee8d656ac3a35aae1162ed021a /drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | |
| parent | drm/simple-kms-helper: Plumb plane state to the enable hook (diff) | |
| download | kernel-e85d30060eddccfcfbf7fdbd61a23cfbda05cc59.tar.gz kernel-e85d30060eddccfcfbf7fdbd61a23cfbda05cc59.zip | |
drm/tinydrm: Make fb_dirty into a lower level hook
mipi_dbi_enable_flush() wants to call the fb->dirty() hook from the
bowels of the .atomic_enable() hook. That prevents us from taking the
plane mutex in fb->dirty() unless we also plumb down the acquire
context.
Instead it seems simpler to split the fb->dirty() into a tinydrm
specific lower level hook that can be called from
mipi_dbi_enable_flush() and from a generic higher level
tinydrm_fb_dirty() helper. As we don't have a tinydrm specific
vfuncs table we'll just stick it into tinydrm_device directly
for now.
v2: Deal with the fb->dirty() in tinydrm_display_pipe_update() as well (Noralf)
Cc: "Noralf Trønnes" <[email protected]>
Cc: David Lechner <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Reviewed-by: Noralf Trønnes <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Noralf Trønnes <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c')
| -rw-r--r-- | drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index d1c3ce9ab294..dcd390163a4a 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -78,6 +78,36 @@ bool tinydrm_merge_clips(struct drm_clip_rect *dst, } EXPORT_SYMBOL(tinydrm_merge_clips); +int tinydrm_fb_dirty(struct drm_framebuffer *fb, + struct drm_file *file_priv, + unsigned int flags, unsigned int color, + struct drm_clip_rect *clips, + unsigned int num_clips) +{ + struct tinydrm_device *tdev = fb->dev->dev_private; + struct drm_plane *plane = &tdev->pipe.plane; + int ret = 0; + + drm_modeset_lock(&plane->mutex, NULL); + + /* fbdev can flush even when we're not interested */ + if (plane->state->fb == fb) { + mutex_lock(&tdev->dirty_lock); + ret = tdev->fb_dirty(fb, file_priv, flags, + color, clips, num_clips); + mutex_unlock(&tdev->dirty_lock); + } + + drm_modeset_unlock(&plane->mutex); + + if (ret) + dev_err_once(fb->dev->dev, + "Failed to update display %d\n", ret); + + return ret; +} +EXPORT_SYMBOL(tinydrm_fb_dirty); + /** * tinydrm_memcpy - Copy clip buffer * @dst: Destination buffer |
