remove duplicated SDL_SetError after calling check_atomic_modesetting()

main
Ozkan Sezer 2020-12-19 01:25:50 +03:00
parent 8952a61324
commit 6b81cac420
2 changed files with 8 additions and 9 deletions

View File

@ -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;
}

View File

@ -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,7 +327,7 @@ 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)
{