@ -140,6 +140,7 @@ bool wlr_drm_resources_init(struct wlr_drm_backend *drm) {
for ( size_t i = 0 ; i < drm - > num_crtcs ; + + i ) {
for ( size_t i = 0 ; i < drm - > num_crtcs ; + + i ) {
struct wlr_drm_crtc * crtc = & drm - > crtcs [ i ] ;
struct wlr_drm_crtc * crtc = & drm - > crtcs [ i ] ;
crtc - > id = res - > crtcs [ i ] ;
crtc - > id = res - > crtcs [ i ] ;
crtc - > legacy_crtc = drmModeGetCrtc ( drm - > fd , crtc - > id ) ;
wlr_drm_get_crtc_props ( drm - > fd , crtc - > id , & crtc - > props ) ;
wlr_drm_get_crtc_props ( drm - > fd , crtc - > id , & crtc - > props ) ;
}
}
@ -166,6 +167,7 @@ void wlr_drm_resources_free(struct wlr_drm_backend *drm) {
for ( size_t i = 0 ; i < drm - > num_crtcs ; + + i ) {
for ( size_t i = 0 ; i < drm - > num_crtcs ; + + i ) {
struct wlr_drm_crtc * crtc = & drm - > crtcs [ i ] ;
struct wlr_drm_crtc * crtc = & drm - > crtcs [ i ] ;
drmModeAtomicFree ( crtc - > atomic ) ;
drmModeAtomicFree ( crtc - > atomic ) ;
drmModeFreeCrtc ( crtc - > legacy_crtc ) ;
if ( crtc - > mode_id ) {
if ( crtc - > mode_id ) {
drmModeDestroyPropertyBlob ( drm - > fd , crtc - > mode_id ) ;
drmModeDestroyPropertyBlob ( drm - > fd , crtc - > mode_id ) ;
}
}
@ -235,8 +237,8 @@ static void wlr_drm_connector_set_gamma(struct wlr_output *output,
static uint32_t wlr_drm_connector_get_gamma_size ( struct wlr_output * output ) {
static uint32_t wlr_drm_connector_get_gamma_size ( struct wlr_output * output ) {
struct wlr_drm_connector * conn = ( struct wlr_drm_connector * ) output ;
struct wlr_drm_connector * conn = ( struct wlr_drm_connector * ) output ;
drmModeCrtc * crtc = conn - > old_crtc ;
struct wlr_drm_backend * drm = ( struct wlr_drm_backend * ) output - > backend ;
return crtc ? crtc - > gamma_size : 0 ;
return drm- > iface - > crtc_get_gamma_size ( drm , conn - > crtc ) ;
}
}
void wlr_drm_connector_start_renderer ( struct wlr_drm_connector * conn ) {
void wlr_drm_connector_start_renderer ( struct wlr_drm_connector * conn ) {