drm: Branch 'master'

[email protected] (Robert Foss) Tue, 3 Apr 2018 08:20:27 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 android/gralloc_handle.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 35affe89d5f617a972b1cfee00c51cbe9e7c64a2
Author: John Stultz <[email protected]>
Date:   Mon Apr 2 20:37:33 2018 -0700

    libdrm: gralloc_handle.h: Fix build issue with Android
    
    In trying to integrate the new gralloc_handle.h with the
    drm_hwcomposer, I started seeing the following compilation
    errors:
    
    In file included from external/drm_hwcomposer/platformdrmgeneric.cpp:28:
    external/libdrm/android/gralloc_handle.h:108:9: error: cannot initialize return object of type 'native_handle_t *' (aka 'native_handle *') with an lvalue of type 'struct gralloc_handle_t *'
            return handle;
                   ^~~~~~
    1 error generated.
    
    This seems to be due to the gralloc_handle_create() definition
    needs to return a native_handle_t * type, rather then a
    gralloc_handle_t *, which is what the code actually returns.
    
    After talking w/ Rob Herring, having the code return the
    native handle should be the proper fix, so that is what
    this patch changes.
    
    Cc: Chih-Wei Huang <[email protected]>
    Cc: Stefan Schake <[email protected]>
    Cc: Robert Foss <[email protected]>
    Cc: Sean Paul <[email protected]>
    Cc: Rob Herring <[email protected]>
    
    Signed-off-by: John Stultz <[email protected]>
    Reviewed-by: Robert Foss <[email protected]>

diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h
index 9cb5a5d7..bcf753da 100644
--- a/android/gralloc_handle.h
+++ b/android/gralloc_handle.h
@@ -105,7 +105,7 @@ static inline native_handle_t *gralloc_handle_create(int32_t width,
 	handle->usage = usage;
 	handle->prime_fd = -1;
 
-	return handle;
+	return nhandle;
 }
 
 #endif

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--