Skip to content

Commit

Permalink
Windowing: GBM - move SetProperty into DRMLegacy
Browse files Browse the repository at this point in the history
  • Loading branch information
a1rwulf committed Jun 22, 2018
1 parent 7230757 commit cfe8c1d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
15 changes: 15 additions & 0 deletions xbmc/windowing/gbm/DRMLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,18 @@ bool CDRMLegacy::SetActive(bool active)

return true;
}

bool CDRMLegacy::SetProperty(struct drm_object *object, const char *name, uint64_t value)
{
uint32_t property_id = this->GetPropertyId(object, name);
if (!property_id)
return false;

if (drmModeObjectSetProperty(m_fd, object->id, object->type, property_id, value) < 0)
{
CLog::Log(LOGERROR, "CDRMLegacy::%s - could not set property %s", __FUNCTION__, name);
return false;
}

return true;
}
1 change: 1 addition & 0 deletions xbmc/windowing/gbm/DRMLegacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class CDRMLegacy : public CDRMUtils
virtual bool SetVideoMode(const RESOLUTION_INFO& res, struct gbm_bo *bo) override;
virtual bool SetActive(bool active) override;
virtual bool InitDrm() override;
virtual bool SetProperty(struct drm_object *object, const char *name, uint64_t value) override;

private:
bool WaitingForFlip();
Expand Down
15 changes: 0 additions & 15 deletions xbmc/windowing/gbm/DRMUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,6 @@ uint32_t CDRMUtils::GetPropertyId(struct drm_object *object, const char *name)
return 0;
}

bool CDRMUtils::SetProperty(struct drm_object *object, const char *name, uint64_t value)
{
uint32_t property_id = this->GetPropertyId(object, name);
if (!property_id)
return false;

if (drmModeObjectSetProperty(m_fd, object->id, object->type, property_id, value) < 0)
{
CLog::Log(LOGERROR, "CDRMUtils::%s - could not set property %s", __FUNCTION__, name);
return false;
}

return true;
}

bool CDRMUtils::GetResources()
{
m_drm_resources = drmModeGetResources(m_fd);
Expand Down
7 changes: 2 additions & 5 deletions xbmc/windowing/gbm/DRMUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ class CDRMUtils
void WaitVBlank();

virtual bool AddProperty(struct drm_object *object, const char *name, uint64_t value) { return false; }
bool SetProperty(struct drm_object *object, const char *name, uint64_t value);

virtual bool SetProperty(struct drm_object *object, const char *name, uint64_t value) { return false; }

int m_fd;

struct connector *m_connector = nullptr;
struct encoder *m_encoder = nullptr;
struct crtc *m_crtc = nullptr;
Expand All @@ -97,8 +95,7 @@ class CDRMUtils
protected:
bool OpenDrm();
uint32_t GetPropertyId(struct drm_object *object, const char *name);

drm_fb * DrmFbGetFromBo(struct gbm_bo *bo);
drm_fb* DrmFbGetFromBo(struct gbm_bo *bo);

private:
bool GetResources();
Expand Down

0 comments on commit cfe8c1d

Please sign in to comment.