OSDN Git Service

android-x86/external-drm_gralloc.git
6 years agogralloc_drm: search the correct drm device
Chih-Wei Huang [Thu, 23 Nov 2017 09:55:45 +0000 (17:55 +0800)]
gralloc_drm: search the correct drm device

Instead of using a hardcoded drm device path, find the correct
drm device according to the driver name.

6 years agoRemove obsolete code
Chih-Wei Huang [Fri, 10 Nov 2017 03:25:43 +0000 (11:25 +0800)]
Remove obsolete code

We don't use any prebuilt GPU libraries.

6 years agogralloc_drm_intel: only use RGBA_8888 in flip mode
Chih-Wei Huang [Tue, 19 Sep 2017 03:16:40 +0000 (11:16 +0800)]
gralloc_drm_intel: only use RGBA_8888 in flip mode

For older GPUs without flip mode support, using RGBA_8888 will cause
significant performance drop as reported by Michael Goffioul.

6 years agoAvoid duplicated macro definition
Chih-Wei Huang [Sat, 9 Sep 2017 16:10:13 +0000 (00:10 +0800)]
Avoid duplicated macro definition

The common used macro MAX() may be defined by other headers and
the compiler may complain. Only define it if it's not defined.

6 years agonouveau: add support for Pascal chipsets
Mauro Rossi [Tue, 22 Aug 2017 21:50:49 +0000 (23:50 +0200)]
nouveau: add support for Pascal chipsets

NV_PASCAL 0x130 chipsets handling is added in gralloc_drm_nouveau.c.

6 years agodrm_gralloc: Enable allocation of flexible YUV420 buffers
Tomasz Figa [Tue, 8 Sep 2015 06:27:03 +0000 (15:27 +0900)]
drm_gralloc: Enable allocation of flexible YUV420 buffers

This patch adds necessary switch cases to enable allocation of flexible
YUV420 buffers. They currently always map to NV12 buffers.

Change-Id: I57daba972698033240f9086b7badfad75335be2e

6 years agodrm_gralloc: Implement lock_ycbcr method
Tomasz Figa [Tue, 8 Sep 2015 06:19:37 +0000 (15:19 +0900)]
drm_gralloc: Implement lock_ycbcr method

It is needed for flexible YUV formats. Currently only flexible YUV420 is
supported and always maps to NV12 format.

Change-Id: I4b2f2d1cdd3f2495b63d84438130dc7ab99fbf8c

6 years agoContinue using BGRA_8888 for nouveau and radeon
Chih-Wei Huang [Sun, 30 Jul 2017 15:28:52 +0000 (23:28 +0800)]
Continue using BGRA_8888 for nouveau and radeon

These GPUs don't support RGBA_8888 well. Let's keep using the old
format.

It partially reverts commit e94fe60a71c18e5b238a2c5f62a93cef06b2cedf.

The patch should be reverted once they support RGBA_8888.

6 years agogralloc_drm: allow GRALLOC_USAGE_HW_VIDEO_ENCODER buffers
Chih-Wei Huang [Wed, 26 Jul 2017 06:03:43 +0000 (14:03 +0800)]
gralloc_drm: allow GRALLOC_USAGE_HW_VIDEO_ENCODER buffers

Inspired by a similar patch of WuZhen <wuzhen@jidemail.com>
to enable screen recording.

Test: can pass PCMark for Android Video Editing tests of Work 2.0.

6 years agoSync GRALLOC_MODULE_PERFORM_GET_DRM_FD definition with gbm_gralloc
Chih-Wei Huang [Tue, 18 Jul 2017 06:33:47 +0000 (14:33 +0800)]
Sync GRALLOC_MODULE_PERFORM_GET_DRM_FD definition with gbm_gralloc

The GRALLOC_MODULE_PERFORM_GET_DRM_FD definition of gbm_gralloc differs
from drm_gralloc. To make them coexist, let's sync the definition.

6 years agoChange default pixel format to RGBA8888
Chih-Wei Huang [Mon, 3 Jul 2017 06:29:29 +0000 (14:29 +0800)]
Change default pixel format to RGBA8888

This is a WIP patch to change the default pixel format to RGBA8888.
The corresponding patches for Mesa are also needed.
Only i965 is tested.

7 years agoUpdate sw usage flags handling marshmallow-x86
Mauro Rossi [Sun, 14 May 2017 20:28:33 +0000 (22:28 +0200)]
Update sw usage flags handling

Inspired by Rob Herring suggestion and gbm_gralloc implementation

Add missing support for GRALLOC_USAGE_SW_READ_OFTEN,
GRALLOC_USAGE_SW_WRITE_OFTEN usage flags
mapping them to PIPE_BIND_LINEAR

Fixes the mouse cursor and message panes artifacts
happening with gralloc_drm_pipe, tested with amdgpudrmfb
No observed regression on swrast llvmpipe

7 years agogralloc_drm_pipe: fix the arguments of resource_get_handle android-x86-6.0-r3
Chih-Wei Huang [Fri, 17 Mar 2017 16:56:19 +0000 (00:56 +0800)]
gralloc_drm_pipe: fix the arguments of resource_get_handle

The second argument is pipe_context and the third is pipe_resource.

Correct the error introduced by commit 397a5a4.

7 years agoremove PIPE_BIND_TRANSFER_READ/WRITE for compatibility with mesa 12.1 android-x86-6.0-r2
Mauro Rossi [Fri, 9 Sep 2016 22:35:58 +0000 (00:35 +0200)]
remove PIPE_BIND_TRANSFER_READ/WRITE for compatibility with mesa 12.1

This changes are the necessary complement to corresponding
mesa commit 5981ab5 "gallium: remove PIPE_BIND_TRANSFER_READ/WRITE"

Fixes the following building errors:

external/drm_gralloc/gralloc_drm_pipe.c:102:11: error: use of undeclared identifier 'PIPE_BIND_TRANSFER_READ'
...
external/drm_gralloc/gralloc_drm_pipe.c:104:11: error: use of undeclared identifier 'PIPE_BIND_TRANSFER_WRITE'

7 years agoandroid: fix gralloc_drm_pipe building error with mesa 12.1
Mauro Rossi [Sat, 27 Aug 2016 15:41:46 +0000 (17:41 +0200)]
android: fix gralloc_drm_pipe building error with mesa 12.1

Fixes a building error introduced by commit 9daaa6f
"gallium: add a pipe_context parameter to resource_get_handle"

The new parameter was introduced for radeonsi future uses
and can be optionally set to NULL for now

7 years agogralloc_drm: show the unsupported error if drv is null android-x86-6.0-r1
Chih-Wei Huang [Mon, 11 Jul 2016 11:37:18 +0000 (19:37 +0800)]
gralloc_drm: show the unsupported error if drv is null

The unsupported driver message was suppressed by a subtle bug
of commit cbf96c0d which treats the latest checking as an else
case. Remove the unnecessary else.

Besides, logically on entering ENABLE_PIPE snippet, drv is
always null. No need to check it.

7 years agodrm_gralloc: fix random crash with wildpointer
Mark Yao [Mon, 27 Jun 2016 01:49:21 +0000 (21:49 -0400)]
drm_gralloc: fix random crash with wildpointer

two drm handle may use same bo, but there is no
reference protect. if one of the drm handle release
the bo, another handle's bo become a wildpointer,
any read/write on the wildpointer will cause system
unstable, crash.

Change-Id: Ieaca522e3372dba82c48961499b9b657ca33cd15
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoSupport multiple exteranl dispaly in mirror mode
WuZhen [Fri, 3 Jun 2016 06:01:09 +0000 (14:01 +0800)]
Support multiple exteranl dispaly in mirror mode

and extend support beyong hdmi.

Change-Id: Ib9550eac0330807ccd4c3919609cbf02ad98299d

7 years agoMaintain a list of connector outputs
WuZhen [Thu, 2 Jun 2016 16:38:15 +0000 (00:38 +0800)]
Maintain a list of connector outputs

Refactor code to support multiple mirrored outputs following code.

Change-Id: I60781d707ae68db2dbd2c4c4122b9183633a74be

7 years agoRename hdmi_output_mode
WuZhen [Thu, 2 Jun 2016 14:56:55 +0000 (22:56 +0800)]
Rename hdmi_output_mode

Rename it to drm_output_mode and move it into gralloc_drm_output
in preparation for folowing changes.

Change-Id: I488f395feede9c9a20eadb9145ebf46295ba4a71

7 years agoBest fit the external display
Ma Jian [Fri, 17 Jun 2016 03:51:07 +0000 (11:51 +0800)]
Best fit the external display

NO_REF_TASK
tested:
1) set persist.remixos.disp_best_fit to true
2) plugin the HDMI, the resolution should be the one fit the primary
   screen (i.e. the resolution should be larger than or equal to primery
   resolution, and it is the closest one)

3) set persist.remixos.disp_best_fit to false
4) plugin HDMI again, the external display will use the default
   resolution.

Change-Id: I80b0fe6e7cc676ce1915f07f267204734bfc645f

7 years agonouveau: add support for latest Kepler and Maxwell chipsets
Mauro Rossi [Sun, 3 Apr 2016 23:32:04 +0000 (01:32 +0200)]
nouveau: add support for latest Kepler and Maxwell chipsets

0x100 and 0x120 chipsets were added in gralloc_drm_nouveau.c

7 years agoandroid: fix gralloc_drm_pipe building error with mesa 11.3
Mauro Rossi [Mon, 28 Mar 2016 20:13:20 +0000 (22:13 +0200)]
android: fix gralloc_drm_pipe building error with mesa 11.3

Fixes a building error introduced by commit 82db518
"gallium: add external usage flags to resource_from(get)_handle (v2)"

parameter usage is required as a  combination of PIPE_HANDLE_USAGE_* flags,
PIPE_HANDLE_USAGE_READ_WRITE was used as the most general case

8 years agoavoid issue with devices that don't support blit.
WuZhen [Wed, 4 May 2016 05:35:33 +0000 (13:35 +0800)]
avoid issue with devices that don't support blit.

Change-Id: I398258147f9adcfbbcf2d92c7ba19887ea917bd0

8 years agoRevert "TEMP HACK: make non-standalone surfaceflinger work"
WuZhen [Mon, 2 May 2016 10:28:44 +0000 (18:28 +0800)]
Revert "TEMP HACK: make non-standalone surfaceflinger work"

This reverts commit b19bbdbf98742f0428f6f4265b5e80d569608abd.

Change-Id: I351b1c3f149924f38635058004eb91d84351646a

8 years agosupport hotplug with vanilla drm uevent
WuZhen [Tue, 3 May 2016 05:58:42 +0000 (13:58 +0800)]
support hotplug with vanilla drm uevent

Change-Id: Ifc83db7bfe6f330ca68e4454516f7a84b2433823

8 years agosupport hdmi clone more for intel GEN8+ gpus
WuZhen [Tue, 3 May 2016 03:49:32 +0000 (11:49 +0800)]
support hdmi clone more for intel GEN8+ gpus

Change-Id: I4e83eb55f2813c92873b8481b8ae9328add4c4f7

8 years agogralloc_drm: use pipe as a fallback instead of default
Mauro Rossi [Sun, 10 Apr 2016 14:22:58 +0000 (16:22 +0200)]
gralloc_drm: use pipe as a fallback instead of default

Current implementation prefers gralloc_drm_pipe over gralloc_drm_{driver}
while it may be the target solution, for nouveau it causes problems
because it is not anymore possible to use gralloc_drm_nouveau
whenever there is a driver ( e.g. swrast) in BoardConfig.mk BOARD_GPU_DRIVERS
not matching the list of valid drivers in drm_gralloc Android.mk

8 years agodrm_gralloc: pipe: add error handling for NULL load_pipe_screen
Rob Herring [Wed, 30 Mar 2016 15:59:36 +0000 (10:59 -0500)]
drm_gralloc: pipe: add error handling for NULL load_pipe_screen

Check load_pipe_screen for NULL and return in case dlsym returns a NULL
pointer. This can happen if the correct gallium driver is not enabled.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoFix gralloc_drm_handle_t size mismatch on 32 and 64 bit builds, take 2
Rob Herring [Wed, 23 Mar 2016 20:48:39 +0000 (15:48 -0500)]
Fix gralloc_drm_handle_t size mismatch on 32 and 64 bit builds, take 2

On x86 there was still a size mismatch due to x86-32 structs not following
natural alignment for 64-bit values. Force the alignment of the union.
Also, there appeared to be some padding on the end, so move the union to
the end of the struct.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agogralloc_drm_pipe: ignore mode_quirk_vmwgfx
Chih-Wei Huang [Fri, 18 Mar 2016 09:21:52 +0000 (17:21 +0800)]
gralloc_drm_pipe: ignore mode_quirk_vmwgfx

Probably we don't need this quirk anymore?

8 years agoRevert "Changed format constants to match what vmwgfx driver expects"
Chih-Wei Huang [Thu, 17 Mar 2016 02:16:54 +0000 (10:16 +0800)]
Revert "Changed format constants to match what vmwgfx driver expects"

This partially reverts commit dc21193e3252ba2d6526546ba1d0c02116baf3ee.

8 years agoAndroid.mk: remove unneeded static libraries
Rob Herring [Tue, 16 Feb 2016 21:46:32 +0000 (15:46 -0600)]
Android.mk: remove unneeded static libraries

With the load_pipe_screen support, these libraries are no longer needed.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoBuild pipe support by default
Rob Herring [Tue, 16 Feb 2016 21:45:25 +0000 (15:45 -0600)]
Build pipe support by default

Build pipe support by default when any unlisted driver is enabled. This way
gralloc doesn't have to be updated for every new driver.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoWIP: synchronize gralloc entry points
Rob Clark [Mon, 31 Aug 2015 17:31:15 +0000 (13:31 -0400)]
WIP: synchronize gralloc entry points

Note entirely sure what synchronization guarantees android provides
before calling in to module.. but stuff inside gralloc module is
definately not thread-safe so slap a big lock around the outside.

8 years agoAdd gralloc_drm_get_prime_fd function
Rob Herring [Fri, 22 Jan 2016 16:35:14 +0000 (10:35 -0600)]
Add gralloc_drm_get_prime_fd function

Mesa EGL needs to retrieve prime fds from gralloc handles.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agopipe: use gallium loader function
Rob Herring [Thu, 21 Jan 2016 13:58:46 +0000 (07:58 -0600)]
pipe: use gallium loader function

Based on Rob Clark's work to avoid duplicating gallium driver loading
code and statically linking each driver's pipe and winsys libraries.

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agofix pipe building with upstream
Rob Herring [Wed, 20 Jan 2016 23:33:55 +0000 (17:33 -0600)]
fix pipe building with upstream

Signed-off-by: Rob Herring <robh@kernel.org>
8 years agoadd padding to gralloc_drm_handle_t
WuZhen [Wed, 6 Jan 2016 09:34:56 +0000 (17:34 +0800)]
add padding to gralloc_drm_handle_t

gralloc_drm_handle_t size differs for 32/64 bit process. thus on
x86_64, this will crash any 32bit app, add propper padding.

Change-Id: I03663b36dd841bf69c84973fd2f5e99741317c15

8 years agoMerge remote-tracking branch 'x86/lollipop-x86' into marshmallow-x86
Chih-Wei Huang [Fri, 13 Nov 2015 16:22:00 +0000 (00:22 +0800)]
Merge remote-tracking branch 'x86/lollipop-x86' into marshmallow-x86

8 years agofix GRALLOC_DRM_HANDLE_NUM_INTS definition for 64-bit lollipop-x86
Mauro Rossi [Sun, 8 Nov 2015 15:29:34 +0000 (16:29 +0100)]
fix GRALLOC_DRM_HANDLE_NUM_INTS definition for 64-bit

As highlighted by pstglia current definition of GRALLOC_DRM_HANDLE_NUM_INTS
causes issues with 64-bit, because a pointer is accounted as having size of
an integer, which is not applicable to 64-bit pointer

The same definition adopted in AOSP hardware/drm_gralloc master branch has
been used, without changing the structure of gralloc_drm_handle_t.

8 years agoRevert "gralloc: Remove localized hw specific pixel format"
Chih-Wei Huang [Fri, 9 Oct 2015 19:41:03 +0000 (03:41 +0800)]
Revert "gralloc: Remove localized hw specific pixel format"

This reverts commit 3e00d3255ba6de08761a6b8f40b838680d502d0b.

8 years agodrm_gralloc: Add drm_gralloc actions to gralloc_drm.h
Sean Paul [Mon, 9 Feb 2015 07:27:39 +0000 (02:27 -0500)]
drm_gralloc: Add drm_gralloc actions to gralloc_drm.h

Change-Id: If640f6ad7c6b904df59b5c5e164f184f1fc97170
Signed-off-by: Sean Paul <seanpaul@chromium.org>
8 years agoWIP: always use gralloc_drm_get_pid()
Rob Clark [Mon, 31 Aug 2015 17:32:21 +0000 (13:32 -0400)]
WIP: always use gralloc_drm_get_pid()

Rather than accessing gralloc_drm_pid directly.

8 years agoandroid: export drm_gralloc headers
Mauro Rossi [Sat, 29 Aug 2015 21:58:53 +0000 (23:58 +0200)]
android: export drm_gralloc headers

8 years agoMerge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86
Chih-Wei Huang [Sun, 26 Jul 2015 16:00:12 +0000 (00:00 +0800)]
Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86

8 years agoCorrect the casting type for radeon drm calls
Paulo Sergio Travaglia [Sun, 28 Jun 2015 22:16:42 +0000 (19:16 -0300)]
Correct the casting type for radeon drm calls

It could be wrong to cast a pointer to a long type
(32-bit signed integer) and extend it to a uint64_t
(64-bit unsigned integer).

Cast it to uintptr_t as the xorg-video-ati does.

8 years agogralloc_drm_pipe: remove unnecessary headers kitkat-x86 android-x86-4.4-r3
Chih-Wei Huang [Fri, 19 Jun 2015 14:57:18 +0000 (22:57 +0800)]
gralloc_drm_pipe: remove unnecessary headers

9 years agoMerge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86
Chih-Wei Huang [Mon, 11 May 2015 01:39:22 +0000 (09:39 +0800)]
Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86

9 years agoInclude newer/missing chipset families
Paulo Sergio Travaglia [Sun, 10 May 2015 16:13:11 +0000 (13:13 -0300)]
Include newer/missing chipset families

 - HAWAII and MULLINS added

 - changed 0x9649 from CHIP_FAMILY_SUMO to CHIP_FAMILY_SUMO2

 - added missing chipInfo for CHIP_FAMILY_VERDE, CHIP_FAMILY_OLAND, CHIP_FAMILY_BONAIRE and CHIP_FAMILY_KAVERI

9 years agogralloc_drm: make GRALLOC_USAGE_SW_READ_OFTEN be a valid usage
Chih-Wei Huang [Wed, 29 Apr 2015 15:09:50 +0000 (23:09 +0800)]
gralloc_drm: make GRALLOC_USAGE_SW_READ_OFTEN be a valid usage

It allows the camera to get a lock on the buffer.
This is required when a picture is taken.

Credited to Edgardo Gho <edgardogho@gmail.com>.

9 years agoMerge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86
Chih-Wei Huang [Wed, 29 Apr 2015 16:12:09 +0000 (00:12 +0800)]
Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86

9 years agoEnable radeonsi on Android-x86
Paulo Sergio Travaglia [Thu, 23 Apr 2015 02:15:48 +0000 (23:15 -0300)]
Enable radeonsi on Android-x86

9 years agodo not use pipe driver for r600g
Chih-Wei Huang [Wed, 29 Apr 2015 09:15:32 +0000 (17:15 +0800)]
do not use pipe driver for r600g

Seems it is buggy.

9 years agoremove unnecessary paths in LOCAL_C_INCLUDES
Chih-Wei Huang [Wed, 29 Apr 2015 09:13:18 +0000 (17:13 +0800)]
remove unnecessary paths in LOCAL_C_INCLUDES

Now the include paths are imported automatically from libdrm*.

9 years agoMerge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86
Chih-Wei Huang [Sun, 19 Apr 2015 06:17:51 +0000 (14:17 +0800)]
Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86

9 years agoChanged format constants to match what vmwgfx driver expects
Paulo Sergio Travaglia [Mon, 16 Feb 2015 23:37:05 +0000 (21:37 -0200)]
Changed format constants to match what vmwgfx driver expects

When allocating a new buffer using pipe driver, pipe constants
are used to define a format based on corresponding HAL_PIXEL_FORMAT
However, vmwgfx driver expects other constants
(SVGA3D_A8R8G8B8, SVGA3D_X8R8G8B8, SVGA3D_R5G6B5, etc)

Changed the returning constants to match what driver expects.

v2: [cwhuang]
 - Use the constants defined in svga3d_types.h.
 - Use C99 standard to avoid building errors with mesa 10.6.

9 years agonouveau: undefine SW_INDICATOR_FULLY_DISABLES_TILING
Chih-Wei Huang [Thu, 29 Jan 2015 06:16:34 +0000 (14:16 +0800)]
nouveau: undefine SW_INDICATOR_FULLY_DISABLES_TILING

Based on the work by pstglia.

9 years agogralloc_drm_pipe: fix building errors with mesa 10.4
Chih-Wei Huang [Thu, 22 Jan 2015 10:18:26 +0000 (18:18 +0800)]
gralloc_drm_pipe: fix building errors with mesa 10.4

9 years agoadd radeonsi to pci_id_driver_map.h
Chih-Wei Huang [Thu, 22 Jan 2015 02:48:03 +0000 (10:48 +0800)]
add radeonsi to pci_id_driver_map.h

9 years agonouveau: bring some sw_indicator love
Emil Velikov [Tue, 11 Nov 2014 03:11:43 +0000 (03:11 +0000)]
nouveau: bring some sw_indicator love

Based on some work by pstglia, one needs to switch off (partially or
fully?) the tiling when creating the BO.

Comment/uncomment the SW_INDICATOR_FULLY_DISABLES_TILING define to
toggle between the two.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agonouveau: update against libdrm_nouveau-2.0
Emil Velikov [Fri, 1 Aug 2014 22:19:03 +0000 (23:19 +0100)]
nouveau: update against libdrm_nouveau-2.0

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoall: Cleanup duplicated macros.
Emil Velikov [Fri, 1 Aug 2014 19:33:17 +0000 (20:33 +0100)]
all: Cleanup duplicated macros.

 - Move MAX macro to gralloc_drm.h
 - Drop the freedreno's duplicated ALIGN macro.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agogralloc_drm_pipe: bail out as soon as the correct screen_create is called
Emil Velikov [Fri, 1 Aug 2014 19:21:30 +0000 (20:21 +0100)]
gralloc_drm_pipe: bail out as soon as the correct screen_create is called

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agogralloc_drm: bail out early when we find the driver
Emil Velikov [Fri, 1 Aug 2014 19:11:07 +0000 (20:11 +0100)]
gralloc_drm: bail out early when we find the driver

... rather than going through all the conditionals.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agofix building issues of 64-bit targets
Chih-Wei Huang [Sun, 30 Nov 2014 17:46:20 +0000 (01:46 +0800)]
fix building issues of 64-bit targets

Just change the 'data' field of gralloc_drm_handle_t
to be a pointer to struct gralloc_drm_bo_t.

Fix some warnings as well.

9 years agoenable multiarch builds
Chih-Wei Huang [Thu, 6 Nov 2014 02:50:12 +0000 (10:50 +0800)]
enable multiarch builds

Convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
to support 64-bit targets.

9 years agofreedreno: completely untested initial support
Rob Clark [Fri, 1 Aug 2014 19:02:02 +0000 (20:02 +0100)]
freedreno: completely untested initial support

v2: [Emil Velikov]
 - drmGetVersion returns the kernel module name.
 - Add it to the build :)
 - freedreno_map returns void * while gralloc::map expects int.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agogralloc_drm: improve log android-x86-4.4-r2
Chih-Wei Huang [Thu, 1 Jan 2015 08:21:46 +0000 (16:21 +0800)]
gralloc_drm: improve log

10 years agoradeon: fix tiling config for family older than 06xx android-x86-4.4-r1
pstglia [Mon, 19 May 2014 03:51:21 +0000 (11:51 +0800)]
radeon: fix tiling config for family older than 06xx

10 years agoget rid of HAL pixelformats 5551 and 4444
Chih-Wei Huang [Tue, 24 Sep 2013 17:33:33 +0000 (01:33 +0800)]
get rid of HAL pixelformats 5551 and 4444

10 years agoradeon: update chipinfo and remove outdated headers
Chih-Wei Huang [Sun, 4 Aug 2013 08:03:37 +0000 (16:03 +0800)]
radeon: update chipinfo and remove outdated headers

Copied radeon.h (radeon_probe.h) and radeon_chipinfo_gen.h from master branch
of http://cgit.freedesktop.org/xorg/driver/xf86-video-ati

10 years agor600g: fix building errors with the latest mesa
Chih-Wei Huang [Fri, 5 Jul 2013 18:57:13 +0000 (02:57 +0800)]
r600g: fix building errors with the latest mesa

10 years agogralloc_drm_intel: fix i915 issues: failed to exec batch
Chih-Wei Huang [Tue, 4 Jun 2013 14:38:15 +0000 (22:38 +0800)]
gralloc_drm_intel: fix i915 issues: failed to exec batch

Old i915 doesn't have I915_EXEC_BLT bit. Only set the bit if it's available.

10 years agoallow to force graphics mode
Somebody [Fri, 29 Mar 2013 05:10:14 +0000 (13:10 +0800)]
allow to force graphics mode

This patch adds in a system property "debug.drm.mode.force", which works
*similarly* to "debug.drm.mode". XRESxYRES[@REFRESHRATE].

10 years agoTEMP HACK: make non-standalone surfaceflinger work
Chih-Wei Huang [Tue, 5 Mar 2013 04:04:31 +0000 (12:04 +0800)]
TEMP HACK: make non-standalone surfaceflinger work

10 years agochange hal name to gralloc.drm
Chih-Wei Huang [Wed, 16 Jan 2013 01:53:17 +0000 (09:53 +0800)]
change hal name to gralloc.drm

10 years agoFix refcounting of mapped bo's
Andy Ross [Tue, 4 Jun 2013 18:32:29 +0000 (11:32 -0700)]
Fix refcounting of mapped bo's

Buffer objects created locally by gralloc_drm_bo_create() would have
their refcount properly initialized to 1, but those received from
other processes via the drv alloc function would be left at zero, so
the delete check in gralloc_drm_bo_decref() would not destroy them as
the refcount would wrap negative.  The buffer would then leak forever
until the mapping process (often surfaceflinger!) exitted.

Issue: AXIA-2991
Change-Id: I1a0c73b21cfbc67b441970002fd71712112e1871
Signed-off-by: Andy Ross <andy.ross@windriver.com>
11 years agogralloc: map HAL format RGBX_8888 to drm format XBGR8888
Tapani Pälli [Tue, 21 May 2013 04:50:18 +0000 (07:50 +0300)]
gralloc: map HAL format RGBX_8888 to drm format XBGR8888

currently we end up creating framebuffers with wrong format for RGBX
users and set_plane with these would show wrong colors, one example
is the menu screen of the glb27 application.

Change-Id: Ifa051a4c5e9f39a6427ae2864ac06955cb48ad2b
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
11 years agogralloc: provide methods for hwc to change handle of a plane
Tapani Pälli [Fri, 3 May 2013 07:08:54 +0000 (10:08 +0300)]
gralloc: provide methods for hwc to change handle of a plane

Patch changes reserve_plane to get id number as additional parameter.
This can be used by hwc to make changes to a particular plane. New
api hwc_set_plane_handle is introduced so that hwc can change the
buffer handle of a plane, this is required because after plane has
been reserved for a particular ui layer, this handle can change as
the layer is typically multibuffered.

Change-Id: I32d711ff3565ae9e8f5b8a6691c22b03a50cefe7
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
11 years agoMerge "gralloc: check possible crtcs of plane against primary output"
Matthew K Gumbel [Thu, 9 May 2013 22:47:30 +0000 (15:47 -0700)]
Merge "gralloc: check possible crtcs of plane against primary output"

11 years agoMerge "gralloc: Remove localized hw specific pixel format"
Andrew P Boie [Thu, 9 May 2013 21:33:09 +0000 (14:33 -0700)]
Merge "gralloc: Remove localized hw specific pixel format"

11 years agogralloc: check possible crtcs of plane against primary output
Tapani Pälli [Fri, 3 May 2013 07:08:54 +0000 (10:08 +0300)]
gralloc: check possible crtcs of plane against primary output

Current implementation supports planes only with primary
output, patch adds a check to guard this.

Change-Id: I537858122a4fe77a374031d11339eaaea27ad9bf
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
11 years agogralloc: cleanup, use ALIGN macro
Tapani Pälli [Mon, 22 Apr 2013 05:20:39 +0000 (08:20 +0300)]
gralloc: cleanup, use ALIGN macro

Change-Id: I029aafe5a99393a4c0f7ff87f422317621fada12
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agoadd ilo to intel_drivers
Chia-I Wu [Fri, 3 May 2013 04:02:05 +0000 (12:02 +0800)]
add ilo to intel_drivers

It is a new Gallium-based driver for Intel GEN6+.

Change-Id: I8a73b6f276d4cc3d38427c2725d63710512bff32

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
11 years agogralloc: Remove localized hw specific pixel format
Sean V Kelley [Wed, 1 May 2013 22:02:39 +0000 (15:02 -0700)]
gralloc: Remove localized hw specific pixel format

Reduces need to build with drm_gralloc headers elsewhere in tree.
Returning to system/graphics.h approach.

Change-Id: I26717cfe0a9a83ab263c26803e2849eb55560696
Depends-Change-Id: I405398b172fab19949fef33c89a60132b1bd0ea9
Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
11 years agogralloc: plane support
Tapani Pälli [Mon, 15 Apr 2013 06:10:09 +0000 (09:10 +0300)]
gralloc: plane support

patch introduces API between hwcomposer and gralloc, hwcomposer can
reserve an overlay plane to be used by a particular layer in prepare
hook, drmModeSetPlane for each plane gets called later when post()
gets called by the eglSwapBuffers (from hwcomposer set), this can be
later changed to use atomic modesetting code and drm properties to
make one 'atomic flip' for graphics + planes.

Change-Id: I3b7d179b285e43eb19fdc3b4c7ce093f3ba6aade
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc_drm: fix building errors with latest mesa
Chih-Wei Huang [Thu, 11 Apr 2013 07:41:50 +0000 (10:41 +0300)]
gralloc_drm: fix building errors with latest mesa

Change-Id: Ifdf23b59542152c364d3ed010a4cc82bbf1a0103
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
11 years agogralloc: use proper mode for hdmi output
Tapani Pälli [Wed, 27 Feb 2013 06:02:06 +0000 (08:02 +0200)]
gralloc: use proper mode for hdmi output

Patch uses the best mode available on hdmi output and creates
a private buffer that is used for pageflipping. Primary display
content is copied to private buffer on each page flip. This
patch removes current hack where same mode is assumed from hdmi
output, this caused graphical artifacts with some tv's. Also
some more debug output is added.

Change-Id: Ic862a8374f46992f0ff92545da8a010f9684b934
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: change copy api and fix copy function for intel
Tapani Pälli [Fri, 22 Feb 2013 10:13:28 +0000 (12:13 +0200)]
gralloc: change copy api and fix copy function for intel

Patch extends current copy api, renames it blit and introduces
src+dst coordinates to be able to implement partial blits and
blits with offsets. Implementation must take care of hw specific
restrictions with blits.

Patch also fixes issues with the current intel_blit function.
Current implementation does not select ring buffer and ends up
queuing blit commands to the render ring. Patch starts to use
drm_intel_bo_mrb_exec to be able to select blit ring and fixes
the checks inside copy function.

Change-Id: I05905e0b9c48fc2a55230212b676bfb8813a2b55
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agomove drm_module_t to a hal private header
Tapani Pälli [Mon, 18 Feb 2013 10:35:42 +0000 (12:35 +0200)]
move drm_module_t to a hal private header

this way it can be accessed by hwcomposer module, which will
be required to implement jellybean mr1 hooks.

Change-Id: I68872243c30aee2d0eb76f38fe54efdea4862a66
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agoMerge "gralloc_drm_bo_lock: add special usage for GRALLOC_USAGE_HW_TEXTURE"
Andrew P Boie [Mon, 4 Feb 2013 18:43:08 +0000 (10:43 -0800)]
Merge "gralloc_drm_bo_lock: add special usage for GRALLOC_USAGE_HW_TEXTURE"

11 years agogralloc: set supported planes for buffers on allocation
Tapani Pälli [Mon, 21 Jan 2013 12:58:33 +0000 (14:58 +0200)]
gralloc: set supported planes for buffers on allocation

This is done so that we should not have to do it dynamically during
composition. This information will be used later with hwcomposer module
when using planes for composition.

Change-Id: I2b6716fe9a8da81050645900c6c0955385946991
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: implement yuv offset query as hw specific function
Tapani Pälli [Fri, 18 Jan 2013 13:01:43 +0000 (15:01 +0200)]
gralloc: implement yuv offset query as hw specific function

This patch reverts earlier cca14cfd... and introduces a new hw
specific hook to query yuv components offsets which can vary
between different hw, decoders, cameras etc.

Change-Id: Ib60bc8ee28df7bc9425b6d7934294fe36fc55354
Depends-Change-Id: I1aa5368b21e588d5d711c1005fff2a5296e143a0
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc_drm_bo_lock: add special usage for GRALLOC_USAGE_HW_TEXTURE
Adrian Marius Negreanu [Fri, 18 Jan 2013 13:12:19 +0000 (15:12 +0200)]
gralloc_drm_bo_lock: add special usage for GRALLOC_USAGE_HW_TEXTURE

The BO 'usage' can be different from the 'usage' passed to lock.

For example when the BO is created by SurfaceMediaSource, having set GRALLOC_USAGE_HW_TEXTURE
while the CPU locks it with GRALLOC_USAGE_SW_WRITE_OFTEN

Change-Id: I4ba0ac05f1833439299e7fd694208076e66f8dfd
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
11 years agogralloc: new function to query the gem handle of buffer_handle_t
Tapani Pälli [Tue, 15 Jan 2013 11:58:57 +0000 (13:58 +0200)]
gralloc: new function to query the gem handle of buffer_handle_t

This function can be used from Mesa instead of having to expose the
whole gralloc_drm_handle_t structure.

Change-Id: I1aa5368b21e588d5d711c1005fff2a5296e143a0
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agoMerge "split gralloc.$(TARGET_PRODUCT)"
Andrew P Boie [Fri, 11 Jan 2013 00:46:44 +0000 (16:46 -0800)]
Merge "split gralloc.$(TARGET_PRODUCT)"

11 years agogralloc: yuv offset calculation function for mesa
Tapani Pälli [Wed, 12 Dec 2012 11:19:11 +0000 (13:19 +0200)]
gralloc: yuv offset calculation function for mesa

Patch adds add api for mesa to query component offsets for
yuv buffer handles.

Change-Id: Ib477627ad812f5b6352665d00fb2bb3b10fe5b8e
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: add NV12 format enum and fb allocation support for it
Tapani Pälli [Fri, 14 Dec 2012 08:43:39 +0000 (10:43 +0200)]
gralloc: add NV12 format enum and fb allocation support for it

Change-Id: If1c92810a17c60c29239f5384d6e971b015dd174
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agosplit gralloc.$(TARGET_PRODUCT)
Adrian Marius Negreanu [Wed, 14 Nov 2012 09:29:48 +0000 (11:29 +0200)]
split gralloc.$(TARGET_PRODUCT)

Some of the functions in gralloc.$(TARGET_PRODUCT) can be reused.
Since one should not link against a HAL library, have gralloc.c
as gralloc.$(TARGET_PRODUCT) and extract the reusable code into
libgralloc_drm.

Change-Id: I08a6989bb0b191ec56662aa4a21f6da7aea6b24d
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>