Fixed whitespace
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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 0ede23f..e84bd5e 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -430,7 +430,7 @@ void print_plane_info(_THIS, drmModePlanePtr plane)
connected to a CRTC so the CRTC scans it,
scales it, etc... and presents it on screen. */
- /* Now we look for the CRTCs supported by the plane. */
+ /* Now we look for the CRTCs supported by the plane. */
resources = KMSDRM_drmModeGetResources(viddata->drm_fd);
if (!resources)
return;
@@ -476,7 +476,7 @@ void get_planes_info(_THIS)
}
/* Print plane info. */
- print_plane_info(_this, plane);
+ print_plane_info(_this, plane);
KMSDRM_drmModeFreePlane(plane);
}
@@ -486,7 +486,7 @@ void get_planes_info(_THIS)
#endif
/* Get the plane_id of a plane that is of the specified plane type (primary,
- overlay, cursor...) and can use the CRTC we have chosen previously. */
+ overlay, cursor...) and can use the CRTC we have chosen previously. */
static int get_plane_id(_THIS, uint32_t plane_type)
{
drmModeRes *resources = NULL;
@@ -588,7 +588,7 @@ setup_plane(_THIS, struct plane **plane, uint32_t plane_type)
if ((*plane)->plane) {
unsigned int i;
(*plane)->props = KMSDRM_drmModeObjectGetProperties(viddata->drm_fd,
- (*plane)->plane->plane_id, DRM_MODE_OBJECT_PLANE);
+ (*plane)->plane->plane_id, DRM_MODE_OBJECT_PLANE);
(*plane)->props_info = SDL_calloc((*plane)->props->count_props,
sizeof(*(*plane)->props_info));
@@ -601,7 +601,7 @@ setup_plane(_THIS, struct plane **plane, uint32_t plane_type)
(*plane)->props_info[i] = KMSDRM_drmModeGetProperty(viddata->drm_fd,
(*plane)->props->props[i]);
}
- }
+ }
cleanup:
@@ -624,10 +624,10 @@ free_plane(struct plane **plane)
(*plane)->plane = NULL;
}
if ((*plane)->props_info) {
- SDL_free((*plane)->props_info);
+ SDL_free((*plane)->props_info);
(*plane)->props_info = NULL;
}
- SDL_free(*plane);
+ SDL_free(*plane);
*plane = NULL;
}
}
@@ -638,13 +638,13 @@ free_plane(struct plane **plane)
/* over to a CONNECTOR->ENCODER system (several CONNECTORS can be connected */
/* to the same PLANE). */
/* Think of a plane as a "frame" sorrounding a picture, where the "picture" */
-/* is the buffer, and we move the "frame" from a picture to another, */
+/* is the buffer, and we move the "frame" from a picture to another, */
/* and the one that has the "frame" is the one sent over to the screen */
/* via the CONNECTOR->ENCODER system. */
/* Think of a PLANE as being "in the middle", it's the CENTRAL part */
/* bewteen the CRTC and the BUFFER that is shown on screen. */
/* What we do here is connect a PLANE to a CRTC and a BUFFER. */
-/* -ALWAYS set the CRTC_ID and FB_ID attribs of a plane at the same time, */
+/* -ALWAYS set the CRTC_ID and FB_ID attribs of a plane at the same time, */
/* meaning IN THE SAME atomic request. */
/* -And NEVER destroy a GBM surface whose buffers are being read by a plane: */
/* first, move the plane away from those buffers and ONLY THEN destroy the */
@@ -658,7 +658,7 @@ drm_atomic_set_plane_props(struct KMSDRM_PlaneInfo *info)
/* Do we have a set of changes already in the making? If not, allocate a new one. */
if (!dispdata->atomic_req)
dispdata->atomic_req = KMSDRM_drmModeAtomicAlloc();
-
+
add_plane_property(dispdata->atomic_req, info->plane, "FB_ID", info->fb_id);
add_plane_property(dispdata->atomic_req, info->plane, "CRTC_ID", info->crtc_id);
add_plane_property(dispdata->atomic_req, info->plane, "SRC_W", info->src_w << 16);
@@ -968,10 +968,10 @@ void KMSDRM_DisplayDataDeinit (_THIS, SDL_DisplayData *dispdata) {
dispdata->connector->connector = NULL;
}
if (dispdata->connector->props_info) {
- SDL_free(dispdata->connector->props_info);
+ SDL_free(dispdata->connector->props_info);
dispdata->connector->props_info = NULL;
}
- SDL_free(dispdata->connector);
+ SDL_free(dispdata->connector);
dispdata->connector = NULL;
}
@@ -982,10 +982,10 @@ void KMSDRM_DisplayDataDeinit (_THIS, SDL_DisplayData *dispdata) {
dispdata->crtc->crtc = NULL;
}
if (dispdata->crtc->props_info) {
- SDL_free(dispdata->crtc->props_info);
+ SDL_free(dispdata->crtc->props_info);
dispdata->crtc->props_info = NULL;
}
- SDL_free(dispdata->crtc);
+ SDL_free(dispdata->crtc);
dispdata->crtc = NULL;
}
}
@@ -1154,9 +1154,9 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
is not valid, or if restoring the current mode fails.
We can always count on the preferred mode! */
for (i = 0; i < connector->count_modes; i++) {
- if (connector->modes[i].type & DRM_MODE_TYPE_PREFERRED) {
- dispdata->preferred_mode = connector->modes[i];
- }
+ if (connector->modes[i].type & DRM_MODE_TYPE_PREFERRED) {
+ dispdata->preferred_mode = connector->modes[i];
+ }
}
/* If the current CRTC's mode isn't valid, select the preferred
@@ -1172,11 +1172,11 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
/* Get CRTC properties */
dispdata->crtc->props = KMSDRM_drmModeObjectGetProperties(viddata->drm_fd,
- crtc->crtc_id, DRM_MODE_OBJECT_CRTC);
+ crtc->crtc_id, DRM_MODE_OBJECT_CRTC);
dispdata->crtc->props_info = SDL_calloc(dispdata->crtc->props->count_props,
sizeof(*dispdata->crtc->props_info));
-
+
if (!dispdata->crtc->props_info) {
ret = SDL_OutOfMemory();
goto cleanup;
@@ -1189,7 +1189,7 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
/* Get connector properties */
dispdata->connector->props = KMSDRM_drmModeObjectGetProperties(viddata->drm_fd,
- connector->connector_id, DRM_MODE_OBJECT_CONNECTOR);
+ connector->connector_id, DRM_MODE_OBJECT_CONNECTOR);
dispdata->connector->props_info = SDL_calloc(dispdata->connector->props->count_props,
sizeof(*dispdata->connector->props_info));
@@ -1203,7 +1203,7 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
dispdata->connector->props_info[i] = KMSDRM_drmModeGetProperty(viddata->drm_fd,
dispdata->connector->props->props[i]);
}
-
+
/* Store the connector and crtc for future use. This is all we keep from this function,
and these are just structs, inoffensive to VK. */
dispdata->connector->connector = connector;
@@ -1213,7 +1213,7 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
/* Block fpr Vulkan compatibility. */
/***********************************/
- /* THIS IS FOR VULKAN! Leave the FD closed, so VK can work.
+ /* THIS IS FOR VULKAN! Leave the FD closed, so VK can work.
Will reopen this in CreateWindow, but only if requested a non-VK window. */
KMSDRM_drmSetClientCap(viddata->drm_fd, DRM_CLIENT_CAP_ATOMIC, 0);
KMSDRM_drmSetClientCap(viddata->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 0);
@@ -1232,11 +1232,11 @@ cleanup:
dispdata->connector->connector = NULL;
}
if (dispdata->crtc->props_info) {
- SDL_free(dispdata->crtc->props_info);
+ SDL_free(dispdata->crtc->props_info);
dispdata->crtc->props_info = NULL;
}
if (dispdata->connector->props_info) {
- SDL_free(dispdata->connector->props_info);
+ SDL_free(dispdata->connector->props_info);
dispdata->connector->props_info = NULL;
}
if (dispdata->crtc->crtc) {
@@ -1347,7 +1347,7 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window *window)
drm_atomic_set_plane_props(&plane_info);
- /* Issue blocking atomic commit. */
+ /* Issue blocking atomic commit. */
if (drm_atomic_commit(_this, SDL_TRUE)) {
SDL_SetError("Failed to issue atomic commit on surfaces destruction.");
}
@@ -1387,7 +1387,7 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window *window)
if (windata->egl_surface != EGL_NO_SURFACE) {
SDL_EGL_DestroySurface(_this, windata->egl_surface);
windata->egl_surface = EGL_NO_SURFACE;
- }
+ }
#endif
if (windata->gs) {
@@ -1407,7 +1407,7 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
uint32_t surface_flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
uint32_t width, height;
- EGLContext egl_context;
+ EGLContext egl_context;
int ret = 0;
@@ -1434,13 +1434,13 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
#if SDL_VIDEO_OPENGL_EGL
/* We can't get the EGL context yet because SDL_CreateRenderer has not been called,
but we need an EGL surface NOW, or GL won't be able to render into any surface
- and we won't see the first frame. */
+ and we won't see the first frame. */
SDL_EGL_SetRequiredVisualId(_this, surface_fmt);
windata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)windata->gs);
if (windata->egl_surface == EGL_NO_SURFACE) {
ret = SDL_SetError("Could not create EGL window surface");
- goto cleanup;
+ goto cleanup;
}
/* Current context passing to EGL is now done here. If something fails,
@@ -1455,8 +1455,8 @@ cleanup:
if (ret) {
/* Error (complete) cleanup. */
if (windata->gs) {
- KMSDRM_gbm_surface_destroy(windata->gs);
- windata->gs = NULL;
+ KMSDRM_gbm_surface_destroy(windata->gs);
+ windata->gs = NULL;
}
}
@@ -1480,13 +1480,13 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window)
KMSDRM_DestroySurfaces(_this, window);
#if SDL_VIDEO_OPENGL_EGL
if (_this->egl_data) {
- SDL_EGL_UnloadLibrary(_this);
+ SDL_EGL_UnloadLibrary(_this);
}
#endif
if (dispdata->gbm_init) {
KMSDRM_DeinitMouse(_this);
KMSDRM_GBMDeinit(_this, dispdata);
- }
+ }
}
/********************************************/
@@ -1522,7 +1522,7 @@ KMSDRM_ReconfigureWindow( _THIS, SDL_Window * window) {
SDL_WindowData *windata = window->driverdata;
SDL_DisplayData *dispdata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
SDL_bool is_vulkan = window->flags & SDL_WINDOW_VULKAN; /* Is this a VK window? */
- float ratio;
+ float ratio;
if (((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) ||
((window->flags & SDL_WINDOW_FULLSCREEN) == SDL_WINDOW_FULLSCREEN)) {
@@ -1532,7 +1532,7 @@ KMSDRM_ReconfigureWindow( _THIS, SDL_Window * window) {
windata->output_w = dispdata->mode.hdisplay;
windata->output_h = dispdata->mode.vdisplay;
windata->output_x = 0;
-
+
} else {
/* Normal non-fullscreen windows are scaled using the CRTC,
@@ -1548,8 +1548,8 @@ KMSDRM_ReconfigureWindow( _THIS, SDL_Window * window) {
if (!is_vulkan) {
if (KMSDRM_CreateSurfaces(_this, window)) {
- return -1;
- }
+ return -1;
+ }
}
return 0;
}
@@ -1617,16 +1617,16 @@ cleanup:
if (ret) {
/* Error (complete) cleanup */
- if (dispdata->display_plane) {
- SDL_free(dispdata->display_plane);
- }
- if (dispdata->crtc) {
- SDL_free(dispdata->crtc);
- }
- if (dispdata->connector) {
- SDL_free(dispdata->connector);
- }
-
+ if (dispdata->display_plane) {
+ SDL_free(dispdata->display_plane);
+ }
+ if (dispdata->crtc) {
+ SDL_free(dispdata->crtc);
+ }
+ if (dispdata->connector) {
+ SDL_free(dispdata->connector);
+ }
+
SDL_free(dispdata);
}
@@ -1681,8 +1681,8 @@ KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
if (!modedata) {
SDL_OutOfMemory();
return;
- }
-
+ }
+
modedata->mode_index = i;
mode.w = conn->modes[i].hdisplay;
@@ -1724,7 +1724,7 @@ KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
SDL_Window *window = viddata->windows[i];
if (KMSDRM_CreateSurfaces(_this, window)) {
- return -1;
+ return -1;
}
/* Tell app about the window resize */
@@ -1774,7 +1774,7 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window)
/* Since we take cursor buffer way from the cursor plane and
destroy the cursor GBM BO when we destroy a window, we must
also manually re-show the cursor on screen, if necessary,
- when we create a window. */
+ when we create a window. */
KMSDRM_InitCursor();
}