@@ -430,7 +430,7 @@ void print_plane_info(_THIS, drmModePlanePtr plane)
430430 connected to a CRTC so the CRTC scans it,
431431 scales it, etc... and presents it on screen. */
432432
433- /* Now we look for the CRTCs supported by the plane. */
433+ /* Now we look for the CRTCs supported by the plane. */
434434 resources = KMSDRM_drmModeGetResources (viddata -> drm_fd );
435435 if (!resources )
436436 return ;
@@ -476,7 +476,7 @@ void get_planes_info(_THIS)
476476 }
477477
478478 /* Print plane info. */
479- print_plane_info (_this , plane );
479+ print_plane_info (_this , plane );
480480 KMSDRM_drmModeFreePlane (plane );
481481 }
482482
@@ -486,7 +486,7 @@ void get_planes_info(_THIS)
486486#endif
487487
488488/* Get the plane_id of a plane that is of the specified plane type (primary,
489- overlay, cursor...) and can use the CRTC we have chosen previously. */
489+ overlay, cursor...) and can use the CRTC we have chosen previously. */
490490static int get_plane_id (_THIS , uint32_t plane_type )
491491{
492492 drmModeRes * resources = NULL ;
@@ -588,7 +588,7 @@ setup_plane(_THIS, struct plane **plane, uint32_t plane_type)
588588 if ((* plane )-> plane ) {
589589 unsigned int i ;
590590 (* plane )-> props = KMSDRM_drmModeObjectGetProperties (viddata -> drm_fd ,
591- (* plane )-> plane -> plane_id , DRM_MODE_OBJECT_PLANE );
591+ (* plane )-> plane -> plane_id , DRM_MODE_OBJECT_PLANE );
592592 (* plane )-> props_info = SDL_calloc ((* plane )-> props -> count_props ,
593593 sizeof (* (* plane )-> props_info ));
594594
@@ -601,7 +601,7 @@ setup_plane(_THIS, struct plane **plane, uint32_t plane_type)
601601 (* plane )-> props_info [i ] = KMSDRM_drmModeGetProperty (viddata -> drm_fd ,
602602 (* plane )-> props -> props [i ]);
603603 }
604- }
604+ }
605605
606606cleanup :
607607
@@ -624,10 +624,10 @@ free_plane(struct plane **plane)
624624 (* plane )-> plane = NULL ;
625625 }
626626 if ((* plane )-> props_info ) {
627- SDL_free ((* plane )-> props_info );
627+ SDL_free ((* plane )-> props_info );
628628 (* plane )-> props_info = NULL ;
629629 }
630- SDL_free (* plane );
630+ SDL_free (* plane );
631631 * plane = NULL ;
632632 }
633633}
@@ -638,13 +638,13 @@ free_plane(struct plane **plane)
638638/* over to a CONNECTOR->ENCODER system (several CONNECTORS can be connected */
639639/* to the same PLANE). */
640640/* Think of a plane as a "frame" sorrounding a picture, where the "picture" */
641- /* is the buffer, and we move the "frame" from a picture to another, */
641+ /* is the buffer, and we move the "frame" from a picture to another, */
642642/* and the one that has the "frame" is the one sent over to the screen */
643643/* via the CONNECTOR->ENCODER system. */
644644/* Think of a PLANE as being "in the middle", it's the CENTRAL part */
645645/* bewteen the CRTC and the BUFFER that is shown on screen. */
646646/* What we do here is connect a PLANE to a CRTC and a BUFFER. */
647- /* -ALWAYS set the CRTC_ID and FB_ID attribs of a plane at the same time, */
647+ /* -ALWAYS set the CRTC_ID and FB_ID attribs of a plane at the same time, */
648648/* meaning IN THE SAME atomic request. */
649649/* -And NEVER destroy a GBM surface whose buffers are being read by a plane: */
650650/* 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)
658658 /* Do we have a set of changes already in the making? If not, allocate a new one. */
659659 if (!dispdata -> atomic_req )
660660 dispdata -> atomic_req = KMSDRM_drmModeAtomicAlloc ();
661-
661+
662662 add_plane_property (dispdata -> atomic_req , info -> plane , "FB_ID" , info -> fb_id );
663663 add_plane_property (dispdata -> atomic_req , info -> plane , "CRTC_ID" , info -> crtc_id );
664664 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) {
968968 dispdata -> connector -> connector = NULL ;
969969 }
970970 if (dispdata -> connector -> props_info ) {
971- SDL_free (dispdata -> connector -> props_info );
971+ SDL_free (dispdata -> connector -> props_info );
972972 dispdata -> connector -> props_info = NULL ;
973973 }
974- SDL_free (dispdata -> connector );
974+ SDL_free (dispdata -> connector );
975975 dispdata -> connector = NULL ;
976976 }
977977
@@ -982,10 +982,10 @@ void KMSDRM_DisplayDataDeinit (_THIS, SDL_DisplayData *dispdata) {
982982 dispdata -> crtc -> crtc = NULL ;
983983 }
984984 if (dispdata -> crtc -> props_info ) {
985- SDL_free (dispdata -> crtc -> props_info );
985+ SDL_free (dispdata -> crtc -> props_info );
986986 dispdata -> crtc -> props_info = NULL ;
987987 }
988- SDL_free (dispdata -> crtc );
988+ SDL_free (dispdata -> crtc );
989989 dispdata -> crtc = NULL ;
990990 }
991991}
@@ -1154,9 +1154,9 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
11541154 is not valid, or if restoring the current mode fails.
11551155 We can always count on the preferred mode! */
11561156 for (i = 0 ; i < connector -> count_modes ; i ++ ) {
1157- if (connector -> modes [i ].type & DRM_MODE_TYPE_PREFERRED ) {
1158- dispdata -> preferred_mode = connector -> modes [i ];
1159- }
1157+ if (connector -> modes [i ].type & DRM_MODE_TYPE_PREFERRED ) {
1158+ dispdata -> preferred_mode = connector -> modes [i ];
1159+ }
11601160 }
11611161
11621162 /* If the current CRTC's mode isn't valid, select the preferred
@@ -1172,11 +1172,11 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
11721172
11731173 /* Get CRTC properties */
11741174 dispdata -> crtc -> props = KMSDRM_drmModeObjectGetProperties (viddata -> drm_fd ,
1175- crtc -> crtc_id , DRM_MODE_OBJECT_CRTC );
1175+ crtc -> crtc_id , DRM_MODE_OBJECT_CRTC );
11761176
11771177 dispdata -> crtc -> props_info = SDL_calloc (dispdata -> crtc -> props -> count_props ,
11781178 sizeof (* dispdata -> crtc -> props_info ));
1179-
1179+
11801180 if (!dispdata -> crtc -> props_info ) {
11811181 ret = SDL_OutOfMemory ();
11821182 goto cleanup ;
@@ -1189,7 +1189,7 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
11891189
11901190 /* Get connector properties */
11911191 dispdata -> connector -> props = KMSDRM_drmModeObjectGetProperties (viddata -> drm_fd ,
1192- connector -> connector_id , DRM_MODE_OBJECT_CONNECTOR );
1192+ connector -> connector_id , DRM_MODE_OBJECT_CONNECTOR );
11931193
11941194 dispdata -> connector -> props_info = SDL_calloc (dispdata -> connector -> props -> count_props ,
11951195 sizeof (* dispdata -> connector -> props_info ));
@@ -1203,7 +1203,7 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
12031203 dispdata -> connector -> props_info [i ] = KMSDRM_drmModeGetProperty (viddata -> drm_fd ,
12041204 dispdata -> connector -> props -> props [i ]);
12051205 }
1206-
1206+
12071207 /* Store the connector and crtc for future use. This is all we keep from this function,
12081208 and these are just structs, inoffensive to VK. */
12091209 dispdata -> connector -> connector = connector ;
@@ -1213,7 +1213,7 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
12131213 /* Block fpr Vulkan compatibility. */
12141214 /***********************************/
12151215
1216- /* THIS IS FOR VULKAN! Leave the FD closed, so VK can work.
1216+ /* THIS IS FOR VULKAN! Leave the FD closed, so VK can work.
12171217 Will reopen this in CreateWindow, but only if requested a non-VK window. */
12181218 KMSDRM_drmSetClientCap (viddata -> drm_fd , DRM_CLIENT_CAP_ATOMIC , 0 );
12191219 KMSDRM_drmSetClientCap (viddata -> drm_fd , DRM_CLIENT_CAP_UNIVERSAL_PLANES , 0 );
@@ -1232,11 +1232,11 @@ int KMSDRM_DisplayDataInit (_THIS, SDL_DisplayData *dispdata) {
12321232 dispdata -> connector -> connector = NULL ;
12331233 }
12341234 if (dispdata -> crtc -> props_info ) {
1235- SDL_free (dispdata -> crtc -> props_info );
1235+ SDL_free (dispdata -> crtc -> props_info );
12361236 dispdata -> crtc -> props_info = NULL ;
12371237 }
12381238 if (dispdata -> connector -> props_info ) {
1239- SDL_free (dispdata -> connector -> props_info );
1239+ SDL_free (dispdata -> connector -> props_info );
12401240 dispdata -> connector -> props_info = NULL ;
12411241 }
12421242 if (dispdata -> crtc -> crtc ) {
@@ -1347,7 +1347,7 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window *window)
13471347
13481348 drm_atomic_set_plane_props (& plane_info );
13491349
1350- /* Issue blocking atomic commit. */
1350+ /* Issue blocking atomic commit. */
13511351 if (drm_atomic_commit (_this , SDL_TRUE )) {
13521352 SDL_SetError ("Failed to issue atomic commit on surfaces destruction." );
13531353 }
@@ -1387,7 +1387,7 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window *window)
13871387 if (windata -> egl_surface != EGL_NO_SURFACE ) {
13881388 SDL_EGL_DestroySurface (_this , windata -> egl_surface );
13891389 windata -> egl_surface = EGL_NO_SURFACE ;
1390- }
1390+ }
13911391#endif
13921392
13931393 if (windata -> gs ) {
@@ -1407,7 +1407,7 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
14071407 uint32_t surface_flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING ;
14081408 uint32_t width , height ;
14091409
1410- EGLContext egl_context ;
1410+ EGLContext egl_context ;
14111411
14121412 int ret = 0 ;
14131413
@@ -1434,13 +1434,13 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
14341434#if SDL_VIDEO_OPENGL_EGL
14351435 /* We can't get the EGL context yet because SDL_CreateRenderer has not been called,
14361436 but we need an EGL surface NOW, or GL won't be able to render into any surface
1437- and we won't see the first frame. */
1437+ and we won't see the first frame. */
14381438 SDL_EGL_SetRequiredVisualId (_this , surface_fmt );
14391439 windata -> egl_surface = SDL_EGL_CreateSurface (_this , (NativeWindowType )windata -> gs );
14401440
14411441 if (windata -> egl_surface == EGL_NO_SURFACE ) {
14421442 ret = SDL_SetError ("Could not create EGL window surface" );
1443- goto cleanup ;
1443+ goto cleanup ;
14441444 }
14451445
14461446 /* Current context passing to EGL is now done here. If something fails,
@@ -1455,8 +1455,8 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
14551455 if (ret ) {
14561456 /* Error (complete) cleanup. */
14571457 if (windata -> gs ) {
1458- KMSDRM_gbm_surface_destroy (windata -> gs );
1459- windata -> gs = NULL ;
1458+ KMSDRM_gbm_surface_destroy (windata -> gs );
1459+ windata -> gs = NULL ;
14601460 }
14611461 }
14621462
@@ -1480,13 +1480,13 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window)
14801480 KMSDRM_DestroySurfaces (_this , window );
14811481#if SDL_VIDEO_OPENGL_EGL
14821482 if (_this -> egl_data ) {
1483- SDL_EGL_UnloadLibrary (_this );
1483+ SDL_EGL_UnloadLibrary (_this );
14841484 }
14851485#endif
14861486 if (dispdata -> gbm_init ) {
14871487 KMSDRM_DeinitMouse (_this );
14881488 KMSDRM_GBMDeinit (_this , dispdata );
1489- }
1489+ }
14901490 }
14911491
14921492 /********************************************/
@@ -1522,7 +1522,7 @@ KMSDRM_ReconfigureWindow( _THIS, SDL_Window * window) {
15221522 SDL_WindowData * windata = window -> driverdata ;
15231523 SDL_DisplayData * dispdata = (SDL_DisplayData * ) SDL_GetDisplayForWindow (window )-> driverdata ;
15241524 SDL_bool is_vulkan = window -> flags & SDL_WINDOW_VULKAN ; /* Is this a VK window? */
1525- float ratio ;
1525+ float ratio ;
15261526
15271527 if (((window -> flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) == SDL_WINDOW_FULLSCREEN_DESKTOP ) ||
15281528 ((window -> flags & SDL_WINDOW_FULLSCREEN ) == SDL_WINDOW_FULLSCREEN )) {
@@ -1532,7 +1532,7 @@ KMSDRM_ReconfigureWindow( _THIS, SDL_Window * window) {
15321532 windata -> output_w = dispdata -> mode .hdisplay ;
15331533 windata -> output_h = dispdata -> mode .vdisplay ;
15341534 windata -> output_x = 0 ;
1535-
1535+
15361536 } else {
15371537
15381538 /* Normal non-fullscreen windows are scaled using the CRTC,
@@ -1548,8 +1548,8 @@ KMSDRM_ReconfigureWindow( _THIS, SDL_Window * window) {
15481548
15491549 if (!is_vulkan ) {
15501550 if (KMSDRM_CreateSurfaces (_this , window )) {
1551- return -1 ;
1552- }
1551+ return -1 ;
1552+ }
15531553 }
15541554 return 0 ;
15551555}
@@ -1617,16 +1617,16 @@ KMSDRM_VideoInit(_THIS)
16171617
16181618 if (ret ) {
16191619 /* Error (complete) cleanup */
1620- if (dispdata -> display_plane ) {
1621- SDL_free (dispdata -> display_plane );
1622- }
1623- if (dispdata -> crtc ) {
1624- SDL_free (dispdata -> crtc );
1625- }
1626- if (dispdata -> connector ) {
1627- SDL_free (dispdata -> connector );
1628- }
1629-
1620+ if (dispdata -> display_plane ) {
1621+ SDL_free (dispdata -> display_plane );
1622+ }
1623+ if (dispdata -> crtc ) {
1624+ SDL_free (dispdata -> crtc );
1625+ }
1626+ if (dispdata -> connector ) {
1627+ SDL_free (dispdata -> connector );
1628+ }
1629+
16301630 SDL_free (dispdata );
16311631 }
16321632
@@ -1681,8 +1681,8 @@ KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
16811681 if (!modedata ) {
16821682 SDL_OutOfMemory ();
16831683 return ;
1684- }
1685-
1684+ }
1685+
16861686 modedata -> mode_index = i ;
16871687
16881688 mode .w = conn -> modes [i ].hdisplay ;
@@ -1724,7 +1724,7 @@ KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
17241724 SDL_Window * window = viddata -> windows [i ];
17251725
17261726 if (KMSDRM_CreateSurfaces (_this , window )) {
1727- return -1 ;
1727+ return -1 ;
17281728 }
17291729
17301730 /* Tell app about the window resize */
@@ -1774,7 +1774,7 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window)
17741774 /* Since we take cursor buffer way from the cursor plane and
17751775 destroy the cursor GBM BO when we destroy a window, we must
17761776 also manually re-show the cursor on screen, if necessary,
1777- when we create a window. */
1777+ when we create a window. */
17781778 KMSDRM_InitCursor ();
17791779 }
17801780
0 commit comments