[KMS/DRM] Small readability changes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index c94f8b2..75e3a84 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -57,8 +57,6 @@
#define KMSDRM_DRI_PATH "/dev/dri/"
-
-
static int set_client_caps (int fd)
{
if (KMSDRM_drmSetClientCap(fd, DRM_CLIENT_CAP_ATOMIC, 1)) {
@@ -75,38 +73,27 @@ check_modesetting(int devindex)
{
SDL_bool available = SDL_FALSE;
char device[512];
- unsigned int i;
int drm_fd;
SDL_snprintf(device, sizeof (device), "%scard%d", KMSDRM_DRI_PATH, devindex);
- SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "check_modesetting: probing \"%s\"", device);
drm_fd = open(device, O_RDWR | O_CLOEXEC);
if (drm_fd >= 0) {
if (SDL_KMSDRM_LoadSymbols()) {
- drmModeRes *resources = (set_client_caps(drm_fd) < 0) ? NULL : KMSDRM_drmModeGetResources(drm_fd);
+ drmModeRes *resources = KMSDRM_drmModeGetResources(drm_fd);
if (resources) {
- SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "%scard%d connector, encoder and CRTC counts are: %d %d %d",
- KMSDRM_DRI_PATH, devindex,
- resources->count_connectors, resources->count_encoders, resources->count_crtcs);
-
- if (resources->count_connectors > 0 && resources->count_encoders > 0 && resources->count_crtcs > 0) {
- for (i = 0; i < resources->count_connectors; i++) {
- drmModeConnector *conn = KMSDRM_drmModeGetConnector(drm_fd, resources->connectors[i]);
-
- if (!conn) {
- continue;
- }
-
- if (conn->connection == DRM_MODE_CONNECTED && conn->count_modes) {
- available = SDL_TRUE;
- }
-
- KMSDRM_drmModeFreeConnector(conn);
- if (available) {
- break;
- }
- }
+
+ SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO,
+ "%scard%d connector, encoder and CRTC counts are: %d %d %d",
+ KMSDRM_DRI_PATH, devindex,
+ resources->count_connectors, resources->count_encoders,
+ resources->count_crtcs);
+
+ if (resources->count_connectors > 0
+ && resources->count_encoders > 0
+ && resources->count_crtcs > 0)
+ {
+ available = SDL_TRUE;
}
KMSDRM_drmModeFreeResources(resources);
}