summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gralloc_drm_kms.c8
-rw-r--r--gralloc_drm_priv.h10
2 files changed, 10 insertions, 8 deletions
diff --git a/gralloc_drm_kms.c b/gralloc_drm_kms.c
index 6cefd6f..a9095f2 100644
--- a/gralloc_drm_kms.c
+++ b/gralloc_drm_kms.c
@@ -439,7 +439,7 @@ int gralloc_drm_set_plane_handle(struct gralloc_drm_t *drm,
static int drm_kms_blit_to_hdmi(struct gralloc_drm_t *drm, struct gralloc_drm_bo_t *bo)
{
int ret = 0;
- if (drm->hdmi.active && drm->hdmi_mode == HDMI_CLONED && drm->hdmi.bo) {
+ if (drm->hdmi.active && drm->hdmi.output_mode == DRM_OUTPUT_CLONED && drm->hdmi.bo) {
int dst_x1 = 0, dst_y1 = 0;
@@ -606,7 +606,7 @@ int gralloc_drm_bo_post(struct gralloc_drm_bo_t *bo)
}
pthread_mutex_lock(&drm->hdmi_mutex);
- if (drm->hdmi.active && drm->hdmi_mode == HDMI_CLONED && drm->hdmi.bo)
+ if (drm->hdmi.active && drm->hdmi.output_mode == DRM_OUTPUT_CLONED && drm->hdmi.bo)
drm_kms_set_crtc(drm, &drm->hdmi, drm->hdmi.bo->fb_id);
pthread_mutex_unlock(&drm->hdmi_mutex);
@@ -647,7 +647,7 @@ int gralloc_drm_bo_post(struct gralloc_drm_bo_t *bo)
ret = drm_kms_set_crtc(drm, &drm->primary, bo->fb_id);
pthread_mutex_lock(&drm->hdmi_mutex);
- if (drm->hdmi.active && drm->hdmi_mode == HDMI_CLONED && drm->hdmi.bo)
+ if (drm->hdmi.active && drm->hdmi.output_mode == DRM_OUTPUT_CLONED && drm->hdmi.bo)
drm_kms_set_crtc(drm, &drm->hdmi, drm->hdmi.bo->fb_id);
pthread_mutex_unlock(&drm->hdmi_mutex);
@@ -1105,7 +1105,7 @@ static int init_hdmi_output(struct gralloc_drm_t *drm,
return err;
}
- drm->hdmi_mode = HDMI_CLONED;
+ drm->hdmi.output_mode = DRM_OUTPUT_CLONED;
drm->hdmi.active = 1;
return 0;
diff --git a/gralloc_drm_priv.h b/gralloc_drm_priv.h
index fd3b72e..9203fba 100644
--- a/gralloc_drm_priv.h
+++ b/gralloc_drm_priv.h
@@ -42,9 +42,10 @@ enum drm_swap_mode {
DRM_SWAP_SETCRTC,
};
-enum hdmi_output_mode {
- HDMI_CLONED,
- HDMI_EXTENDED,
+enum drm_output_mode {
+ DRM_OUTPUT_PRIMARY,
+ DRM_OUTPUT_CLONED,
+ DRM_OUTPUT_EXTENDED,
};
struct gralloc_drm_plane_t {
@@ -84,6 +85,8 @@ struct gralloc_drm_output
int bpp;
uint32_t active;
+ enum drm_output_mode output_mode;
+
/* 'private fb' for this output */
struct gralloc_drm_bo_t *bo;
};
@@ -97,7 +100,6 @@ struct gralloc_drm_t {
drmModeResPtr resources;
struct gralloc_drm_output primary;
struct gralloc_drm_output hdmi;
- enum hdmi_output_mode hdmi_mode;
/* hdmi hotplug */
pthread_mutex_t hdmi_mutex;