summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-06 09:33:17 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-07 14:39:46 -0400
commit0341d08831436faa6d280ec8b040654c417491a2 (patch)
treea6e921433fe9a9a5700f5705ee626fbf3e36ac12 /src/lib/ecore_drm
parent1ab4975491f184f11b4c6407218669805a29894e (diff)
ecore-drm: Add some debug code to spit out planes and plane properties
Summary: This adds a debug function to spit out planes and their properties while debugging rotation support 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.c124
1 files changed, 124 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index fbd2a2a53e..5a1f5312cd 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -706,6 +706,123 @@ next:
706 } 706 }
707} 707}
708 708
709static void
710_ecore_drm_output_planes_get(Ecore_Drm_Device *dev)
711{
712 drmModePlaneRes *pres;
713 unsigned int i = 0, j = 0;
714 int k = 0;
715
716 pres = drmModeGetPlaneResources(dev->drm.fd);
717 if (!pres) return;
718
719 for (; i < pres->count_planes; i++)
720 {
721 drmModePlane *plane;
722 drmModeObjectPropertiesPtr props;
723 int type = -1;
724
725 plane = drmModeGetPlane(dev->drm.fd, pres->planes[i]);
726 if (!plane) continue;
727
728 props = drmModeObjectGetProperties(dev->drm.fd, plane->plane_id,
729 DRM_MODE_OBJECT_PLANE);
730 if (!props) goto free_plane;
731
732 DBG("Plane %u Properties:", plane->plane_id);
733
734 for (j = 0; type == -1 && j < props->count_props; j++)
735 {
736 drmModePropertyPtr prop;
737
738 prop = drmModeGetProperty(dev->drm.fd, props->props[j]);
739 if (!prop) continue;
740
741 if (!strcmp(prop->name, "type"))
742 {
743 type = props->prop_values[j];
744 DBG("\tType: %d", type);
745 for (k = 0; k < prop->count_enums; k++)
746 {
747 DBG("\t\t%s=%llu", prop->enums[k].name,
748 prop->enums[k].value);
749 }
750 }
751
752 drmModeFreeProperty(prop);
753 }
754
755 DBG("\tFormats:");
756 for (j = 0; j < plane->count_formats; j++)
757 DBG("\t\t%4.4s", (char *)&plane->formats[j]);
758
759 for (j = 0; j < props->count_props; j++ )
760 {
761 drmModePropertyPtr prop;
762
763 prop = drmModeGetProperty(dev->drm.fd, props->props[j]);
764 if (!prop) continue;
765
766 DBG("\tProperty Name: %s", prop->name);
767
768 if (prop->flags & DRM_MODE_PROP_RANGE)
769 {
770 DBG("\t\tRange Property");
771 for (k = 0; k < prop->count_values; k++)
772 DBG("\t\t\t%"PRIu64, prop->values[k]);
773 }
774 if (prop->flags & DRM_MODE_PROP_ENUM)
775 {
776 DBG("\t\tEnum Property");
777 for (k = 0; k < prop->count_enums; k++)
778 DBG("\t\t\t%s=%llu", prop->enums[k].name,
779 prop->enums[k].value);
780 }
781 if (prop->flags & DRM_MODE_PROP_BITMASK)
782 {
783 DBG("\t\tBitmask Property");
784 for (k = 0; k < prop->count_enums; k++)
785 DBG("\t\t\t%s=0x%llx", prop->enums[k].name,
786 (1LL << prop->enums[k].value));
787 }
788
789 if (!strcmp(prop->name, "rotation"))
790 {
791 DBG("\t\tSupported Rotations:");
792 for (k = 0; k < prop->count_enums; k++)
793 {
794 if (!strcmp(prop->enums[k].name, "rotate-0"))
795 DBG("\t\t\tRotate 0");
796 else if (!strcmp(prop->enums[k].name, "rotate-90"))
797 DBG("\t\t\tRotate 90");
798 else if (!strcmp(prop->enums[k].name, "rotate-180"))
799 DBG("\t\t\tRotate 180");
800 else if (!strcmp(prop->enums[k].name, "rotate-270"))
801 DBG("\t\t\tRotate 270");
802 else if (!strcmp(prop->enums[k].name, "reflect-x"))
803 DBG("\t\t\tReflect X");
804 else if (!strcmp(prop->enums[k].name, "reflect-y"))
805 DBG("\t\t\tReflect Y");
806 else
807 DBG("\t\t\t%s", prop->enums[k].name);
808 }
809 }
810
811 drmModeFreeProperty(prop);
812 }
813
814 DBG("\tCurrent Crtc: %d", plane->crtc_id);
815 DBG("\tPossible Crtcs: 0x%08x", plane->possible_crtcs);
816
817 drmModeFreeObjectProperties(props);
818
819free_plane:
820 drmModeFreePlane(plane);
821 }
822
823 drmModeFreePlaneResources(pres);
824}
825
709/* public functions */ 826/* public functions */
710 827
711/** 828/**
@@ -752,6 +869,12 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
752 dev->max_width = res->max_width; 869 dev->max_width = res->max_width;
753 dev->max_height = res->max_height; 870 dev->max_height = res->max_height;
754 871
872 /* DBG("Dev Size"); */
873 /* DBG("\tMin Width: %u", res->min_width); */
874 /* DBG("\tMin Height: %u", res->min_height); */
875 /* DBG("\tMax Width: %u", res->max_width); */
876 /* DBG("\tMax Height: %u", res->max_height); */
877
755 for (i = 0; i < res->count_connectors; i++) 878 for (i = 0; i < res->count_connectors; i++)
756 { 879 {
757 /* get the connector */ 880 /* get the connector */
@@ -775,6 +898,7 @@ next:
775 } 898 }
776 899
777 /* TODO: Planes */ 900 /* TODO: Planes */
901 _ecore_drm_output_planes_get(dev);
778 902
779 ret = EINA_TRUE; 903 ret = EINA_TRUE;
780 if (eina_list_count(dev->outputs) < 1) 904 if (eina_list_count(dev->outputs) < 1)