[PATCH v2 4/9] drm/ast: Pin and map cursor source BO during update
Gerd Hoffmann
kraxel at redhat.com
Wed Jun 12 08:15:01 UTC 2019
On Tue, Jun 11, 2019 at 03:03:39PM +0200, Thomas Zimmermann wrote:
> The ast driver used to lock the cursor source BO during updates. Locking
> should be done internally by the BO's implementation, so we pin it instead
> to system memory. The mapping information is also stored in the BO. No
> need to have an extra argument to the kmap function.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
> drivers/gpu/drm/ast/ast_mode.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index cb6e8249a7db..be3d91d7fde5 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -1183,7 +1183,6 @@ static int ast_cursor_set(struct drm_crtc *crtc,
> u64 gpu_addr;
> u32 csum;
> int ret;
> - struct ttm_bo_kmap_obj uobj_map;
> u8 *src, *dst;
> bool src_isiomem, dst_isiomem;
> if (!handle) {
> @@ -1201,15 +1200,13 @@ static int ast_cursor_set(struct drm_crtc *crtc,
> }
> gbo = drm_gem_vram_of_gem(obj);
>
> - ret = drm_gem_vram_lock(gbo, false);
> + ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_SYSTEM);
For a temporary pin like this one using pl_flag = 0 should be fine.
cheers,
Gerd
More information about the dri-devel
mailing list