OSDN Git Service

android-x86/external-drm_gralloc.git
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: 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>
11 years agogralloc: use headers from drm and mesa instead of local copy
Tapani Pälli [Thu, 8 Nov 2012 07:52:27 +0000 (09:52 +0200)]
gralloc: use headers from drm and mesa instead of local copy

Patch removes local outdated headers for intel hw and starts
to depend on ones from libdrm and mesa projects, this makes sure
we are up to date with new pci id's etc.

intel_init_kms_features required some fixing because of changed
macros, patch also adds GEN7 check in place for IVB and HSW.

Change-Id: Iee6375ceb558baf4334e3b9b5d26210406aa7b71
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: no cloned mode on platforms with hdmi as primary
Tapani Pälli [Wed, 7 Nov 2012 14:06:03 +0000 (16:06 +0200)]
gralloc: no cloned mode on platforms with hdmi as primary

On some platforms we might have only HDMI connector, on those
platforms do not attempt to use cloned/extended mode with HDMI.

Change-Id: If0f21986030e4e97991202bd8168d7c9e25de493
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: hdmi cloned mode support
Tapani Pälli [Thu, 4 Oct 2012 13:01:27 +0000 (16:01 +0300)]
gralloc: hdmi cloned mode support

Patch implements simple support for cloned mode hdmi by introducing
primary and hdmi outputs that are updated respectively.

Current implementation is rather naive and assumes hdmi can drive
same mode as the local lvds. Only cloned mode is supported but can be
extended later to support extended mode when hwcomposer is available
for controlling this behaviour.

HDMI hotplug is implemented as a separate observer thread that
listens to uevents and reads hdmi connection state from there, this
requires switch support from the kernel hdmi driver.

Change-Id: I147273bbe4d21ab9f390f38c9a5f945530c8fd2e
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
11 years agoRevert "gralloc: hdmi cloned mode support"
Daniel Leung [Tue, 23 Oct 2012 22:31:34 +0000 (15:31 -0700)]
Revert "gralloc: hdmi cloned mode support"

This reverts commit 2d2758bca0f962ef21673dbe29df4c042d7f3254.

11 years agogralloc: hdmi cloned mode support
Tapani Pälli [Thu, 4 Oct 2012 13:01:27 +0000 (16:01 +0300)]
gralloc: hdmi cloned mode support

Patch implements simple support for cloned mode hdmi by introducing
primary and hdmi outputs that are updated respectively.

Current implementation is rather naive and assumes hdmi can drive
same mode as the local lvds. Only cloned mode is supported but can be
extended later to support extended mode when hwcomposer is available
for controlling this behaviour.

HDMI hotplug is implemented as a separate observer thread that
listens to uevents and reads hdmi connection state from there, this
requires switch support from the kernel hdmi driver.

Change-Id: I1d5873214d672563789f4953a892de60539eca88
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
11 years agogralloc_drm_intel: set gem handle for each bo
Tapani Pälli [Fri, 31 Aug 2012 09:56:31 +0000 (12:56 +0300)]
gralloc_drm_intel: set gem handle for each bo

not just fbs, potentially anything can be used as framebuffer by kms code

Change-Id: Ib710bb62ae23cf58a987c6614306711dedb11cbf
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: split resolve_drm_format
Tapani Pälli [Fri, 31 Aug 2012 09:55:26 +0000 (12:55 +0300)]
gralloc: split resolve_drm_format

refactored code so that drm_format_from_hal helper
can be used from other parts of code.

Change-Id: Ibaa3e483b2987c96d9651b2886360402e2c5642d
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: introduce planeresources
Tapani Pälli [Fri, 31 Aug 2012 09:54:45 +0000 (12:54 +0300)]
gralloc: introduce planeresources

maintain planeresources and additional helper structure
gralloc_drm_plane_t for planes, also prints out plane formats on startup.

Change-Id: Ibc717d646acd581b8c247c22d269260e78d92fd9
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: add refcount to gralloc_drm_bo_t
Tapani Pälli [Wed, 1 Aug 2012 13:06:00 +0000 (16:06 +0300)]
gralloc: add refcount to gralloc_drm_bo_t

This is an basic enabler for gralloc to let buffers live while they are still
in use by gralloc (for example during scanout), otherwise Android may choose
to destroy them while they are still needed. This facility will get used with
upcoming plane support and direct rendering support.

Change-Id: I2f0bc595846a68e8d2feb5138b022d16f207e2b5
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc : use drmModeAddFB2
Tapani Pälli [Wed, 30 May 2012 07:59:29 +0000 (10:59 +0300)]
gralloc : use drmModeAddFB2

start using drmModeAddFB2 API, this is enabler to create framebuffers
with YUV pixel formats that can be shown on hardware overlay.

Change-Id: I700c752ada119222573ab286a8b231092c3250c0
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
11 years agogralloc: Add support for prebuilt gralloc libs
Andrew Boie [Tue, 25 Sep 2012 23:19:24 +0000 (16:19 -0700)]
gralloc: Add support for prebuilt gralloc libs

If the user sets BOARD_GPU_DRIVERS to 'prebuilt' and passes a path
to the prebuilt gralloc binary via BOARD_GPU_DRIVER_BINARY, then
that prebuilt gralloc image will be used instead of building it from
source here.

Change-Id: I0fe3bc1919cacc38087afe3f76e4b8391975edbd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
11 years agoChange all occurances of LOGE to ALOGE, LOGW to ALOGW and LOGI to ALOGI due to change...
Charles Johnson [Wed, 11 Jul 2012 00:51:32 +0000 (17:51 -0700)]
Change all occurances of LOGE to ALOGE, LOGW to ALOGW and LOGI to ALOGI due to change in Jelly Bean.

Signed-off-by: Charles Johnson <charles.f.johnson@intel.com>
modified:   gralloc.c
modified:   gralloc_drm.c
modified:   gralloc_drm_intel.c
modified:   gralloc_drm_kms.c
modified:   gralloc_drm_nouveau.c
modified:   gralloc_drm_pipe.c
modified:   gralloc_drm_radeon.c

Change-Id: Idd9e533eab366d9f9dc199d961891255a66384a2

12 years agoadd support for YUV formats honeycomb-x86
Chia-I Wu [Thu, 27 Oct 2011 10:01:23 +0000 (18:01 +0800)]
add support for YUV formats

12 years agoremove an unnecessary include
Chia-I Wu [Thu, 8 Sep 2011 04:18:53 +0000 (12:18 +0800)]
remove an unnecessary include

12 years agolog connector info
Chia-I Wu [Thu, 8 Sep 2011 04:05:00 +0000 (12:05 +0800)]
log connector info

Log the number of modes available, what the best mode is, and etc.

12 years agoremove outdated BOARD_USES_*
Chia-I Wu [Mon, 29 Aug 2011 06:57:41 +0000 (14:57 +0800)]
remove outdated BOARD_USES_*

12 years agoremove first drm_kms_wait_for_post call
Chia-I Wu [Mon, 29 Aug 2011 06:54:12 +0000 (14:54 +0800)]
remove first drm_kms_wait_for_post call

It always fails without the CRTC being set.

12 years agofix build errors
Chia-I Wu [Mon, 29 Aug 2011 06:52:55 +0000 (14:52 +0800)]
fix build errors

Introduced by the last commit.

12 years agovmwgfx: assorted fixes
Chia-I Wu [Wed, 24 Aug 2011 06:07:06 +0000 (14:07 +0800)]
vmwgfx: assorted fixes

Based on trial and error, we know

 - drm_kms_wait_for_post() hangs the VM
 - drmModeDirtyFB() should be called whenever the front buffer changes
 - drmModePageFlip() is not supported

They might not be entirely correct, but fixing them makes drm_gralloc
work.

12 years agoupdate pci_ids
Chia-I Wu [Wed, 24 Aug 2011 06:05:29 +0000 (14:05 +0800)]
update pci_ids

12 years agoradeon: use a table to detect chip family gingerbread-x86
Chia-I Wu [Wed, 10 Aug 2011 09:43:28 +0000 (17:43 +0800)]
radeon: use a table to detect chip family

12 years agodrop the 'c' suffix from i915c/i965c
Chia-I Wu [Wed, 3 Aug 2011 04:35:06 +0000 (13:35 +0900)]
drop the 'c' suffix from i915c/i965c

12 years agorevise gralloc_drm bo interface
Chia-I Wu [Sun, 31 Jul 2011 07:35:21 +0000 (16:35 +0900)]
revise gralloc_drm bo interface

Make it more intuitive to use.

12 years agoadd more functions to gralloc_drm kms interface
Chia-I Wu [Sun, 31 Jul 2011 08:09:11 +0000 (17:09 +0900)]
add more functions to gralloc_drm kms interface

Make it more complete.

12 years agoadd support for debug.drm.mode
Chia-I Wu [Sat, 30 Jul 2011 08:06:31 +0000 (17:06 +0900)]
add support for debug.drm.mode

The mode string is "<xres>x<yres>[@<bpp>]".

12 years agoprotect against NULL handle
Chia-I Wu [Sat, 30 Jul 2011 06:43:48 +0000 (15:43 +0900)]
protect against NULL handle

12 years agomake sure the driver is initialized before registering
Chia-I Wu [Sat, 30 Jul 2011 07:31:24 +0000 (16:31 +0900)]
make sure the driver is initialized before registering

12 years agoallow FB to be mapped
Chia-I Wu [Sat, 30 Jul 2011 07:29:54 +0000 (16:29 +0900)]
allow FB to be mapped

This is useful for testing software renderer with FB.

12 years agomap a bo only when it is locked for CPU access
Chia-I Wu [Fri, 29 Jul 2011 11:43:12 +0000 (20:43 +0900)]
map a bo only when it is locked for CPU access

To match the doc a little better.

12 years agoclose bo on unregister()
Chia-I Wu [Fri, 29 Jul 2011 10:57:04 +0000 (19:57 +0900)]
close bo on unregister()

Not sure if a remote process ever destroys a bo.  But let register()
opens a bo and unregister() closes it.

12 years agoandroid: use BOARD_GPU_DRIVERS
Chia-I Wu [Fri, 22 Jul 2011 05:42:19 +0000 (13:42 +0800)]
android: use BOARD_GPU_DRIVERS

12 years agoradeon: zero the newly allocated bo
Chia-I Wu [Mon, 18 Jul 2011 09:47:28 +0000 (17:47 +0800)]
radeon: zero the newly allocated bo

12 years agoradeon: refactor bo allocation
Chia-I Wu [Mon, 18 Jul 2011 09:43:31 +0000 (17:43 +0800)]
radeon: refactor bo allocation

12 years agoradeon: verbose debug messages on errors
Chia-I Wu [Mon, 18 Jul 2011 05:24:05 +0000 (13:24 +0800)]
radeon: verbose debug messages on errors

12 years agoimprove bo validation a little bit
Chia-I Wu [Fri, 15 Jul 2011 02:46:06 +0000 (10:46 +0800)]
improve bo validation a little bit

12 years agoradeon: enable tiling
Chia-I Wu [Fri, 15 Jul 2011 02:18:58 +0000 (10:18 +0800)]
radeon: enable tiling

12 years agoradeon: detect chip family
Chia-I Wu [Thu, 14 Jul 2011 06:42:30 +0000 (14:42 +0800)]
radeon: detect chip family

This should not change the behavior in any way.

12 years agosupport other drivers in pipe
Chia-I Wu [Sun, 10 Jul 2011 12:17:41 +0000 (20:17 +0800)]
support other drivers in pipe

Tested with r600g.

12 years agolet drivers decide the fb format
Chia-I Wu [Sun, 10 Jul 2011 15:12:26 +0000 (23:12 +0800)]
let drivers decide the fb format

12 years agoadd (untested) copy support to pipe
Chia-I Wu [Mon, 13 Jun 2011 06:34:21 +0000 (14:34 +0800)]
add (untested) copy support to pipe

This is why we love pipe.

12 years agoadd (untested) pipe support
Chia-I Wu [Mon, 13 Jun 2011 00:48:44 +0000 (08:48 +0800)]
add (untested) pipe support

12 years agoadd nouveau support
Chia-I Wu [Sun, 12 Jun 2011 10:43:33 +0000 (18:43 +0800)]
add nouveau support

12 years agoinitial commit
Chia-I Wu [Sun, 12 Jun 2011 08:21:30 +0000 (16:21 +0800)]
initial commit