Skip to content

Commit

Permalink
Update to upstream Switchres.
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioginer committed May 1, 2022
1 parent f667256 commit d455119
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion 3rdparty/switchres/custom_video_drmkms.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 4 additions & 0 deletions 3rdparty/switchres/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/switchres/switchres_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d455119

Please sign in to comment.