Skip to content

Commit

Permalink
[drmkms] Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioginer committed Sep 29, 2023
1 parent bd37c21 commit f8f686d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_video_drmkms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,17 +538,19 @@ bool drmkms_timing::init()
else if (strlen(m_device_name) == 1 && m_device_name[0] >= '0' && m_device_name[0] <= '9')
screen_pos = m_device_name[0] - '0';

// Get an array of drm devices to check
drmDevicePtr devices[MAX_DRM_DEVICES];
int num_devices = drmGetDevices2(0, NULL, 0);

if (num_devices > MAX_DRM_DEVICES)
num_devices = MAX_DRM_DEVICES;

int ret = drmGetDevices2(0, devices, num_devices);
if (ret < 0) {
log_error("DRM/KMS: drmGetDevices2() returned an error %d\n", ret);
return false;
}
if (ret < 0)
{
log_error("DRM/KMS: drmGetDevices2() returned an error %d\n", ret);
return false;
}

char *drm_name;
drmModeRes *p_res;
Expand Down

0 comments on commit f8f686d

Please sign in to comment.