diff --git a/3rdparty/switchres/custom_video_drmkms.h b/3rdparty/switchres/custom_video_drmkms.h index 0ca43a32bcbec..43e2a3acf47c3 100644 --- a/3rdparty/switchres/custom_video_drmkms.h +++ b/3rdparty/switchres/custom_video_drmkms.h @@ -26,7 +26,6 @@ class drmkms_timing : public custom_video drmkms_timing(char *device_name, custom_video_settings *vs); ~drmkms_timing(); const char *api_name() { return "DRMKMS"; } - //int caps() { return CUSTOM_VIDEO_CAPS_ADD | CUSTOM_VIDEO_CAPS_UPDATE; } int caps() { return m_caps; } bool init(); diff --git a/3rdparty/switchres/makefile b/3rdparty/switchres/makefile index 93f215f90e95d..168715d1d574f 100644 --- a/3rdparty/switchres/makefile +++ b/3rdparty/switchres/makefile @@ -3,6 +3,7 @@ PLATFORM := $(shell uname) MAIN = switchres_main STANDALONE = switchres TARGET_LIB = libswitchres +DRMHOOK_LIB = libdrmhook GRID = grid SRC = monitor.cpp modeline.cpp switchres.cpp display.cpp custom_video.cpp log.cpp switchres_wrapper.cpp edid.cpp OBJS = $(SRC:.cpp=.o) @@ -112,6 +113,9 @@ $(TARGET_LIB): $(OBJS) $(FINAL_CXX) -c $(CPPFLAGS) -DSR_WIN32_STATIC switchres_wrapper.cpp -o switchres_wrapper.o $(FINAL_AR) rcs $@.$(STATIC_LIB_EXT) $(^) +$(DRMHOOK_LIB): + $(FINAL_CXX) drm_hook.cpp -shared -ldl -fPIC -I/usr/include/libdrm -o libdrmhook.so + $(GRID): $(FINAL_CXX) grid.cpp -lSDL2 -o grid diff --git a/3rdparty/switchres/switchres_wrapper.cpp b/3rdparty/switchres/switchres_wrapper.cpp index dcf86e0a3d04a..70f317d984af9 100644 --- a/3rdparty/switchres/switchres_wrapper.cpp +++ b/3rdparty/switchres/switchres_wrapper.cpp @@ -69,8 +69,8 @@ MODULE_API void sr_set_user_mode(int width, int height, int refresh) { void disp_best_mode_to_sr_mode(display_manager* disp, sr_mode* srm) { - srm->width = disp->width(); - srm->height = disp->height(); + srm->width = disp->best_mode()->hactive; + srm->height = disp->best_mode()->vactive; srm->refresh = disp->v_freq(); srm->is_refresh_off = (disp->is_refresh_off() ? 1 : 0); srm->is_stretched = (disp->is_stretched() ? 1 : 0);