drm: remove mode_str and vrefresh args from init_drm

We'll change these at runtime, so let's stop taking them as init
args. They were unused.
This commit is contained in:
Simon Ser 2021-07-20 15:53:15 +02:00
parent a22e9d3c0d
commit af1ba566ba
3 changed files with 3 additions and 19 deletions

View file

@ -348,7 +348,7 @@ static bool get_properties(struct drm_t *drm, uint32_t obj_id, uint32_t obj_type
} }
int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsigned int vrefresh) int init_drm(struct drm_t *drm, const char *device)
{ {
drmModeRes *resources; drmModeRes *resources;
drmModeConnector *connector = NULL; drmModeConnector *connector = NULL;
@ -393,22 +393,6 @@ int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsign
return -1; return -1;
} }
/* find user requested mode: */
if (mode_str && *mode_str) {
for (i = 0; i < connector->count_modes; i++) {
drmModeModeInfo *current_mode = &connector->modes[i];
if (strcmp(current_mode->name, mode_str) == 0) {
if (vrefresh == 0 || current_mode->vrefresh == vrefresh) {
drm->mode = current_mode;
break;
}
}
}
if (!drm->mode)
fprintf(stderr, "requested mode not found, using default mode!\n");
}
/* find preferred mode or the highest resolution mode: */ /* find preferred mode or the highest resolution mode: */
if (!drm->mode) { if (!drm->mode) {
for (i = 0, area = 0; i < connector->count_modes; i++) { for (i = 0, area = 0; i < connector->count_modes; i++) {

View file

@ -102,7 +102,7 @@ extern bool g_bUseLayers;
extern bool g_bRotated; extern bool g_bRotated;
extern bool g_bDebugLayers; extern bool g_bDebugLayers;
int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsigned int vrefresh); int init_drm(struct drm_t *drm, const char *device);
int drm_atomic_commit(struct drm_t *drm, struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline ); int drm_atomic_commit(struct drm_t *drm, struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline );
uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_buffer *buf, struct wlr_dmabuf_attributes *dma_buf ); uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_buffer *buf, struct wlr_dmabuf_attributes *dma_buf );
void drm_drop_fbid( struct drm_t *drm, uint32_t fbid ); void drm_drop_fbid( struct drm_t *drm, uint32_t fbid );

View file

@ -237,7 +237,7 @@ int initOutput(void)
} }
else else
{ {
return init_drm( &g_DRM, nullptr, nullptr, 0 ); return init_drm( &g_DRM, nullptr );
} }
} }