summaryrefslogtreecommitdiffstats
path: root/gralloc_drm_priv.h
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2012-10-04 16:01:27 +0300
committerTapani Pälli <tapani.palli@intel.com>2012-10-24 15:34:01 +0300
commitb89d7caffeea06e568e9df7da6c6c39ec63b9a1d (patch)
tree5ee13a207f245945f9765f3169ccc198c6f136ae /gralloc_drm_priv.h
parent8075c812370fdc1aeb049322c6033d35eb4cd530 (diff)
downloadexternal_drm_gralloc-b89d7caffeea06e568e9df7da6c6c39ec63b9a1d.zip
external_drm_gralloc-b89d7caffeea06e568e9df7da6c6c39ec63b9a1d.tar.gz
external_drm_gralloc-b89d7caffeea06e568e9df7da6c6c39ec63b9a1d.tar.bz2
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>
Diffstat (limited to 'gralloc_drm_priv.h')
-rw-r--r--gralloc_drm_priv.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/gralloc_drm_priv.h b/gralloc_drm_priv.h
index d22fea0..7a93a1e 100644
--- a/gralloc_drm_priv.h
+++ b/gralloc_drm_priv.h
@@ -24,6 +24,7 @@
#ifndef _GRALLOC_DRM_PRIV_H_
#define _GRALLOC_DRM_PRIV_H_
+#include <pthread.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
@@ -37,10 +38,26 @@ enum drm_swap_mode {
DRM_SWAP_SETCRTC,
};
+enum hdmi_output_mode {
+ HDMI_CLONED,
+ HDMI_EXTENDED,
+};
+
struct gralloc_drm_plane_t {
drmModePlane *drm_plane;
};
+struct gralloc_drm_output
+{
+ uint32_t crtc_id;
+ uint32_t connector_id;
+ drmModeModeInfo mode;
+ int xdpi, ydpi;
+ int fb_format;
+ int bpp;
+ uint32_t active;
+};
+
struct gralloc_drm_t {
/* initialized by gralloc_drm_create */
int fd;
@@ -48,16 +65,19 @@ struct gralloc_drm_t {
/* initialized by gralloc_drm_init_kms */
drmModeResPtr resources;
- uint32_t crtc_id;
- uint32_t connector_id;
- drmModeModeInfo mode;
- int xdpi, ydpi;
+ struct gralloc_drm_output primary;
+ struct gralloc_drm_output hdmi;
+ enum hdmi_output_mode hdmi_mode;
+
+ /* hdmi hotplug */
+ pthread_mutex_t hdmi_mutex;
+ pthread_t hdmi_hotplug_thread;
+
#ifdef DRM_MODE_FEATURE_DIRTYFB
drmModeClip clip;
#endif
/* initialized by drv->init_kms_features */
- int fb_format;
enum drm_swap_mode swap_mode;
int swap_interval;
int mode_quirk_vmwgfx;