OSDN Git Service

android-x86/external-gbm_gralloc.git
7 years agogbm_gralloc: Remove the invalid int cast and assignment in gbm_mod_perform()
John Stultz [Wed, 29 Mar 2017 03:48:36 +0000 (20:48 -0700)]
gbm_gralloc: Remove the invalid int cast and assignment in gbm_mod_perform()

In gbm_mod_perform(), for the cmd GRALLOC_MODULE_PERFORM_GET_USAGE,
the code takes the third argument, casts it as an int* and then writes
a zero into what the pointer points to.

The problem with this is that the third argument to that function is
actually a native_handle_t, so writing zero to the first int in that
structure ends up overwriting the version value, causing the
native_handle_t code to see the value as corrupt.

This results in lots of warnings and leaked fds.

Change-Id: If64770c164557b467f76ca97ddc182565730d394
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Vishal Bhoj <vishal.bhoj@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoChange module name to gralloc.gbm
Rob Herring [Wed, 22 Mar 2017 16:45:29 +0000 (11:45 -0500)]
Change module name to gralloc.gbm

Originally, the intent was to make GBM gralloc a drop-in replacement for
DRM gralloc, but this isn't really happening or needed. Change the name
so both can coexist.

Change-Id: I4eff839523213cc76c56746275d8ba7534ba9c12
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoFix mapping for non-zero starting coordinates
Rob Herring [Tue, 13 Dec 2016 15:37:06 +0000 (09:37 -0600)]
Fix mapping for non-zero starting coordinates

While the gralloc API allows for specifying the starting coordinates (L,T),
it seems this doesn't really work. No other gralloc implementations found
use the rectangle bounds. Not exactly sure how this ever worked, but it
broke recently with AOSP master.

Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoAdd YV12 pixel format support
Rob Herring [Thu, 8 Sep 2016 22:45:03 +0000 (17:45 -0500)]
Add YV12 pixel format support

GBM doesn't support YV12 and we need a single buffer, so request GR88 from
GBM instead and adjust the width and height. GR88 also ensures (hopefully)
that the GPU texture alignment requirements are met.

Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoRemove unused gralloc_drm_handle_t::name
Rob Herring [Tue, 19 Jul 2016 03:06:03 +0000 (22:06 -0500)]
Remove unused gralloc_drm_handle_t::name

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
[robh: keep the name member for now for ABI/API compatibility with mesa]
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoUse alternative GRALLOC_GBM_HANDLE_MAGIC
Emil Velikov [Mon, 18 Jul 2016 15:10:26 +0000 (16:10 +0100)]
Use alternative GRALLOC_GBM_HANDLE_MAGIC

Using 0x5f47424d ("_GBM") is less likely to colide than the generic
0x12345678.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoOpen the device node with O_CLOEXEC
Emil Velikov [Mon, 18 Jul 2016 15:51:12 +0000 (16:51 +0100)]
Open the device node with O_CLOEXEC

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
Not 100% sure it is supported on Android.

7 years agoDon't leak the FD in the gbm_dev_create error path
Emil Velikov [Mon, 18 Jul 2016 15:47:54 +0000 (16:47 +0100)]
Don't leak the FD in the gbm_dev_create error path

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoKill off unused variable
Emil Velikov [Mon, 18 Jul 2016 15:46:51 +0000 (16:46 +0100)]
Kill off unused variable

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoMerge pull request #2 from robertfoss/master
Rob Herring [Tue, 25 Oct 2016 21:52:01 +0000 (16:52 -0500)]
Merge pull request #2 from robertfoss/master

GRALLOC_MODULE_PERFORM_GET_USAGE stub and compiler warning fix

7 years agoStub out GRALLOC_MODULE_PERFORM_GET_USAGE
Robert Foss [Fri, 16 Sep 2016 21:21:11 +0000 (17:21 -0400)]
Stub out GRALLOC_MODULE_PERFORM_GET_USAGE

This implements an initial stub for GRALLOC_MODULE_PERFORM_GET_USAGE

Signed-off-by: Robert Foss <robert.foss@collabora.com>
7 years agoSilence compiler type narrowing errors
Robert Foss [Fri, 16 Sep 2016 22:28:26 +0000 (18:28 -0400)]
Silence compiler type narrowing errors

Add static_cast to op, to prevent compiler warnings.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
8 years agoFix RGB565 pixel format type
Rob Herring [Wed, 1 Jun 2016 21:30:34 +0000 (16:30 -0500)]
Fix RGB565 pixel format type

The component ordering was wrong causing GBM allocation failures.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoClean-up of unused code
Rob Herring [Fri, 22 Apr 2016 17:54:14 +0000 (12:54 -0500)]
Clean-up of unused code

Remove some unused code throwing warnings.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agogbm_map: update to revised gbm_bo_map API
Rob Herring [Fri, 22 Apr 2016 17:52:45 +0000 (12:52 -0500)]
gbm_map: update to revised gbm_bo_map API

Add stride return parameter and properly pass usage flags.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoUpdate usage flag handling
Rob Herring [Fri, 22 Apr 2016 17:50:35 +0000 (12:50 -0500)]
Update usage flag handling

Add missing support for GRALLOC_USAGE_SW_READ_OFTEN,
GRALLOC_USAGE_SW_WRITE_OFTEN, GRALLOC_USAGE_HW_TEXTURE, and
GRALLOC_USAGE_CURSOR usage flags mapping them to GBM flags.

For now, cursor flag is commented out because the Android side doesn't seem
to honor a larger stride.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoInitial GBM based gralloc
Rob Herring [Sun, 12 Jun 2011 08:21:30 +0000 (16:21 +0800)]
Initial GBM based gralloc

Based on drm_gralloc. Some remants of drm_gralloc remain to be
compatible with mesa and drm_hwcomposer.

Signed-off-by: Rob Herring <robh@kernel.org>