aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-06-23 11:10:42 -0400
committerChris Michael <cp.michael@samsung.com>2015-06-23 11:11:29 -0400
commit1d981756b9ab57344da0bce72ab317f3eae79e7c (patch)
treef8bb7be52dc5e001f7a53320138e290636c58f30 /src/lib/ecore_drm
parentecore-drm: Fix issue of outputs not getting registered with the wayland registry (diff)
downloadefl-1d981756b9ab57344da0bce72ab317f3eae79e7c.tar.gz
ecore-drm: Fix setting proper output subpixel value
Summary: This adds a minor internal function to convert DRM_MODE_SUBPIXEL values into something that the wayland protocol supports. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index e9da98c691..b0fdeb2e0f 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -402,6 +402,28 @@ _ecore_drm_output_backlight_shutdown(Ecore_Drm_Backlight *backlight)
free(backlight);
}
+static int
+_ecore_drm_output_subpixel_get(int subpixel)
+{
+ switch (subpixel)
+ {
+ case DRM_MODE_SUBPIXEL_UNKNOWN:
+ return 0; // WL_OUTPUT_SUBPIXEL_UNKNOWN;
+ case DRM_MODE_SUBPIXEL_NONE:
+ return 1; //WL_OUTPUT_SUBPIXEL_NONE;
+ case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
+ return 2; //WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB;
+ case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
+ return 3; // WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR;
+ case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
+ return 4; // WL_OUTPUT_SUBPIXEL_VERTICAL_RGB;
+ case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
+ return 5; //WL_OUTPUT_SUBPIXEL_VERTICAL_BGR;
+ default:
+ return 0; // WL_OUTPUT_SUBPIXEL_UNKNOWN;
+ }
+}
+
static Ecore_Drm_Output *
_ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnector *conn, int x, int y, Eina_Bool cloned)
{
@@ -428,7 +450,7 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnecto
output->cloned = cloned;
output->phys_width = conn->mmWidth;
output->phys_height = conn->mmHeight;
- output->subpixel = conn->subpixel;
+ output->subpixel = _ecore_drm_output_subpixel_get(conn->subpixel);
output->make = eina_stringshare_add("UNKNOWN");
output->model = eina_stringshare_add("UNKNOWN");