remove duplicated SDL_SetError after calling check_atomic_modesetting()
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 66 67 68 69 70 71 72
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 74d138b..b097372 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -391,17 +391,16 @@ void print_plane_info(_THIS, drmModePlanePtr plane)
drmModeRes *resources;
uint32_t type = 0;
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
+ int i;
drmModeObjectPropertiesPtr props = KMSDRM_drmModeObjectGetProperties(viddata->drm_fd,
plane->plane_id, DRM_MODE_OBJECT_PLANE);
/* Search the plane props for the plane type. */
- for (int j = 0; j < props->count_props; j++) {
-
- drmModePropertyPtr p = KMSDRM_drmModeGetProperty(viddata->drm_fd, props->props[j]);
-
+ for (i = 0; i < props->count_props; i++) {
+ drmModePropertyPtr p = KMSDRM_drmModeGetProperty(viddata->drm_fd, props->props[i]);
if ((strcmp(p->name, "type") == 0)) {
- type = props->prop_values[j];
+ type = props->prop_values[i];
}
KMSDRM_drmModeFreeProperty(p);
@@ -432,7 +431,7 @@ void print_plane_info(_THIS, drmModePlanePtr plane)
return;
printf("--PLANE ID: %d\nPLANE TYPE: %s\nCRTC READING THIS PLANE: %d\nCRTCS SUPPORTED BY THIS PLANE: ", plane->plane_id, plane_type, plane->crtc_id);
- for (int i = 0; i < resources->count_crtcs; i++) {
+ for (i = 0; i < resources->count_crtcs; i++) {
if (plane->possible_crtcs & (1 << i)) {
uint32_t crtc_id = resources->crtcs[i];
printf ("%d", crtc_id);
@@ -1031,7 +1030,6 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
/* Try ATOMIC compatibility */
ret = check_atomic_modesetting(viddata->drm_fd);
if (ret) {
- ret = SDL_SetError("not compatible with atomic modesetting");
goto cleanup;
}
diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.c b/src/video/kmsdrm/SDL_kmsdrmvulkan.c
index 49d4cf7..3b52951 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvulkan.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.c
@@ -202,6 +202,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS,
VkResult result;
SDL_bool ret = SDL_FALSE;
+ int i;
/* Get the function pointers for the functions we will use. */
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
@@ -326,14 +327,14 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS,
because videomode determines how big the scanout region is and we can't
scanout a region bigger than the window (we would be reading past the
buffer, and Vulkan would give us a confusing VK_ERROR_SURFACE_LOST_KHR). */
- for (int i = 0; i < mode_count; i++) {
+ for (i = 0; i < mode_count; i++) {
if (modes_props[i].parameters.visibleRegion.width <= window->w &&
modes_props[i].parameters.visibleRegion.height <= window->h)
{
display_mode_props = modes_props[i];
break;
}
- }
+ }
if (display_mode_props.parameters.visibleRegion.width == 0
|| display_mode_props.parameters.visibleRegion.height == 0)