drivers/gpu/drm/openchrome/openchrome_object.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit a5f6bd6fb6bdb23104b082093602c1288ea53265
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Wed Nov 27 09:08:33 2019 -0800

    drm/openchrome: Kernel map a BO after pinning is finished
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c 
b/drivers/gpu/drm/openchrome/openchrome_object.c
index 7ec9d3c53d1b..f19f8f8130ed 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -194,14 +194,15 @@ int openchrome_bo_create(struct drm_device *dev,
                }
 
                ret = openchrome_bo_pin(bo, ttm_domain);
-               if (!ret) {
-                       ret = ttm_bo_kmap(&bo->ttm_bo, 0,
-                                               bo->ttm_bo.num_pages,
-                                               &bo->kmap);
-
+               ttm_bo_unreserve(&bo->ttm_bo);
+               if (ret) {
+                       ttm_bo_put(&bo->ttm_bo);
+                       goto exit;
                }
 
-               ttm_bo_unreserve(&bo->ttm_bo);
+               ret = ttm_bo_kmap(&bo->ttm_bo, 0,
+                                       bo->ttm_bo.num_pages,
+                                       &bo->kmap);
                if (ret) {
                        ttm_bo_put(&bo->ttm_bo);
                        goto exit;
@@ -224,13 +225,13 @@ void openchrome_bo_destroy(struct openchrome_bo *bo, bool 
kmap)
        DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
        if (kmap) {
+               ttm_bo_kunmap(&bo->kmap);
+
                ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
                if (ret) {
                        goto exit;
                }
 
-               ttm_bo_kunmap(&bo->kmap);
-
                ret = openchrome_bo_unpin(bo);
                ttm_bo_unreserve(&bo->ttm_bo);
                if (ret) {
_______________________________________________
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to