5 #define LOC QString("DRMPlane: ")
14 if (Type == DRM_PLANE_TYPE_OVERLAY)
return "Overlay";
15 if (Type == DRM_PLANE_TYPE_CURSOR)
return "Cursor";
16 if (Type == DRM_PLANE_TYPE_PRIMARY)
return "Primary";
23 if (
auto plane = std::shared_ptr<MythDRMPlane>(
new MythDRMPlane(FD, Id, Index)); plane && plane->m_id)
31 if (
auto * plane = drmModeGetPlane(FD, Id); plane)
33 auto id = plane->plane_id;
40 for (uint32_t j = 0; j < plane->count_formats; ++j)
42 m_formats.emplace_back(plane->formats[j]);
69 drmModeFreePlane(plane);
75 return QString(
"Plane #%1 %2 Index: %3 FB: %4 CRTC: %5 Formats: %6")
83 auto * planes = drmModeGetPlaneResources(FD);
86 LOG(VB_GENERAL, LOG_ERR, QString(drmGetDeviceNameFromFd2(FD)) +
": Failed to retrieve planes");
90 for (uint32_t index = 0; index < planes->count_planes; ++index)
94 if ((CRTCFilter > -1) && !(plane->m_possibleCrtcs & (1 << CRTCFilter)))
96 result.emplace_back(plane);
100 drmModeFreePlaneResources(planes);
107 for (
const auto & plane : Planes)
108 if ((plane->m_type == DRM_PLANE_TYPE_PRIMARY) && !plane->m_videoFormats.empty())
109 result.emplace_back(plane);
117 for (
const auto & plane : Planes)
118 if ((plane->m_type == DRM_PLANE_TYPE_OVERLAY) &&
HasOverlayFormat(plane->m_formats))
119 result.emplace_back(plane);
130 case DRM_FORMAT_RGB565:
return "RGB565";
131 case DRM_FORMAT_XRGB8888:
return "XRGB8888";
132 case DRM_FORMAT_XBGR8888:
return "XBGR8888";
133 case DRM_FORMAT_ARGB8888:
return "ARGB8888";
134 case DRM_FORMAT_RGBA8888:
return "RGBA8888";
135 case DRM_FORMAT_ABGR8888:
return "ABGR8888";
136 case DRM_FORMAT_BGRA8888:
return "BGRA8888";
137 case DRM_FORMAT_XRGB2101010:
return "XRGB2101010";
138 case DRM_FORMAT_XBGR2101010:
return "XBGR2101010";
139 case DRM_FORMAT_ARGB2101010:
return "ARGB2101010";
140 case DRM_FORMAT_ABGR2101010:
return "ABGR2101010";
154 for (
auto format : Formats)
169 DRM_FORMAT_YUV410, DRM_FORMAT_YVU410, DRM_FORMAT_YUV411, DRM_FORMAT_YVU411,
171 DRM_FORMAT_YUV444, DRM_FORMAT_YVU444,
173 DRM_FORMAT_YUYV, DRM_FORMAT_YVYU, DRM_FORMAT_UYVY, DRM_FORMAT_VYUY
176 return std::find(s_yuvFormats.cbegin(), s_yuvFormats.cend(),
Format) != s_yuvFormats.cend();
186 DRM_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888, DRM_FORMAT_XBGR8888,
187 DRM_FORMAT_ARGB8888, DRM_FORMAT_ABGR8888, DRM_FORMAT_RGB565,
188 DRM_FORMAT_BGR565, DRM_FORMAT_XRGB2101010, DRM_FORMAT_XBGR2101010,
189 DRM_FORMAT_ARGB2101010, DRM_FORMAT_ABGR2101010
192 for (
auto format : Formats)
193 if (std::any_of(s_rgbFormats.cbegin(), s_rgbFormats.cend(), [&format](
auto Format) { return Format == format; }))
204 DRM_FORMAT_ARGB8888, DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB2101010, DRM_FORMAT_ABGR2101010
207 for (
auto format : s_alphaFormats)
208 if (std::any_of(Formats.cbegin(), Formats.cend(), [&format](
auto Format) { return Format == format; }))