summaryrefslogtreecommitdiff
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
parentc6b997eb172d10a91968c7461ecec0938c8444b5 (diff)
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)
402 free(backlight); 402 free(backlight);
403} 403}
404 404
405static int
406_ecore_drm_output_subpixel_get(int subpixel)
407{
408 switch (subpixel)
409 {
410 case DRM_MODE_SUBPIXEL_UNKNOWN:
411 return 0; // WL_OUTPUT_SUBPIXEL_UNKNOWN;
412 case DRM_MODE_SUBPIXEL_NONE:
413 return 1; //WL_OUTPUT_SUBPIXEL_NONE;
414 case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
415 return 2; //WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB;
416 case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
417 return 3; // WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR;
418 case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
419 return 4; // WL_OUTPUT_SUBPIXEL_VERTICAL_RGB;
420 case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
421 return 5; //WL_OUTPUT_SUBPIXEL_VERTICAL_BGR;
422 default:
423 return 0; // WL_OUTPUT_SUBPIXEL_UNKNOWN;
424 }
425}
426
405static Ecore_Drm_Output * 427static Ecore_Drm_Output *
406_ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnector *conn, int x, int y, Eina_Bool cloned) 428_ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnector *conn, int x, int y, Eina_Bool cloned)
407{ 429{
@@ -428,7 +450,7 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnecto
428 output->cloned = cloned; 450 output->cloned = cloned;
429 output->phys_width = conn->mmWidth; 451 output->phys_width = conn->mmWidth;
430 output->phys_height = conn->mmHeight; 452 output->phys_height = conn->mmHeight;
431 output->subpixel = conn->subpixel; 453 output->subpixel = _ecore_drm_output_subpixel_get(conn->subpixel);
432 454
433 output->make = eina_stringshare_add("UNKNOWN"); 455 output->make = eina_stringshare_add("UNKNOWN");
434 output->model = eina_stringshare_add("UNKNOWN"); 456 output->model = eina_stringshare_add("UNKNOWN");