Skip to content

Commit

Permalink
MythDRMCrtc: Sundry cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Jan 19, 2021
1 parent 6bd74fa commit ab066d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions mythtv/libs/libmythui/platforms/drm/mythdrmcrtc.cpp
Expand Up @@ -28,23 +28,24 @@ DRMCrtcs MythDRMCrtc::GetCrtcs(int FD)
{
DRMCrtcs result;
if (auto resources = MythDRMResources(FD); *resources)
{
for (auto i = 0; i < resources->count_crtcs; ++i)
if (auto crtc = Create(FD, resources->crtcs[i], i); crtc.get())
result.emplace_back(crtc);

}
return result;
}

MythDRMCrtc::MythDRMCrtc(int FD, uint32_t Id, int Index)
{
if (auto crtc = drmModeGetCrtc(FD, Id); crtc)
if (auto * crtc = drmModeGetCrtc(FD, Id); crtc)
{
m_index = Index;
m_id = crtc->crtc_id;
m_fbId = crtc->buffer_id;
m_x = crtc->x;
m_y = crtc->y;
m_width = crtc->width;
m_index = Index;
m_id = crtc->crtc_id;
m_fbId = crtc->buffer_id;
m_x = crtc->x;
m_y = crtc->y;
m_width = crtc->width;
m_height = crtc->height;
if (crtc->mode_valid)
m_mode = MythDRMMode::Create(&crtc->mode, 0);
Expand All @@ -63,7 +64,7 @@ int MythDRMCrtc::RetrieveCRTCIndex(int FD, uint32_t Id)
{
for (auto i = 0; i < resources->count_crtcs; ++i)
{
if (auto crtc = drmModeGetCrtc(FD, resources->crtcs[i]); crtc)
if (auto * crtc = drmModeGetCrtc(FD, resources->crtcs[i]); crtc)
{
bool match = crtc->crtc_id == Id;
drmModeFreeCrtc(crtc);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/platforms/drm/mythdrmcrtc.h
Expand Up @@ -27,7 +27,7 @@ class MUI_PUBLIC MythDRMCrtc

protected:
MythDRMCrtc(int FD, uint32_t Id, int Index);
int RetrieveCRTCIndex(int FD, uint32_t Id);
static int RetrieveCRTCIndex(int FD, uint32_t Id);

private:
Q_DISABLE_COPY(MythDRMCrtc)
Expand Down

0 comments on commit ab066d0

Please sign in to comment.