From 28d12a899645be09dae7e4cb8c293bf7fc64d6ad Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 30 Nov 2023 11:34:15 -0800 Subject: til: wire up til_video_setup_t throughout *_fb Preparatory commit for aspect ratio settings at the fb layer. This slightly reworks how main::setup_video() integrates the selected fb backend's setup_func to better resemble how the module setup_funcs work now, with more clearly separated settings-building and setup-baking/finalizing phases. Which makes inserting the ratio setting in the middle of the front-end and back-end setup_funcs fairly trivial. Not a fan of all the casts, but there will probably be more helpers introduced to take care of that and make til_video_setup_t more of a first-class thing facilitating the fb stuff. --- src/drm_fb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/drm_fb.c') diff --git a/src/drm_fb.c b/src/drm_fb.c index 5d7f259..2dd4f98 100644 --- a/src/drm_fb.c +++ b/src/drm_fb.c @@ -14,6 +14,7 @@ #include "til_fb.h" #include "til_settings.h" #include "til_util.h" +#include "til_video_setup.h" /* drm fb backend, everything drm-specific in rototiller resides here. */ typedef struct drm_fb_page_t drm_fb_page_t; @@ -37,7 +38,7 @@ typedef struct drm_fb_t { } drm_fb_t; typedef struct drm_fb_setup_t { - til_setup_t til_setup; + til_video_setup_t til_video_setup; const char *dev; const char *connector; const char *mode; @@ -330,7 +331,7 @@ static drmModeModeInfo * lookup_mode(drmModeConnector *connector, const char *mo /* prepare the drm context for use with the supplied settings */ -static int drm_fb_init(const char *title, const til_setup_t *setup, void **res_context) +static int drm_fb_init(const char *title, const til_video_setup_t *setup, void **res_context) { drm_fb_setup_t *s = (drm_fb_setup_t *)setup; drm_fb_t *c; @@ -598,7 +599,7 @@ static int drm_fb_setup(const til_settings_t *settings, til_setting_t **res_sett if (!setup) return -ENOMEM; - return til_settings_apply_desc_generators(settings, generators, nelems(generators), &setup->til_setup, res_setting, res_desc, res_setup); + return til_settings_apply_desc_generators(settings, generators, nelems(generators), &setup->til_video_setup.til_setup, res_setting, res_desc, res_setup); } -- cgit v1.2.1