diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-05-14 18:17:54 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-05-14 18:17:54 -0700 |
commit | 66ee371516c48c30b67684317a8e3c24ba7f1f4e (patch) | |
tree | 6b9ac8d8384a76ced0120211e8f7cbf4e1737be2 | |
parent | af09c0ca1fe1687e5d455103fff781caf8dd9e21 (diff) |
Assume the Xserver provides xf86ModeBandwidth now
It was added by xorg/xserver@1768af38c737f4c14d32f587b51a8ec3d3d6ed5f
which was included in the xserver 1.10 release, which is now less than
our minimum required, so we don't need to check for it and provide a
fallback any longer.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/11>
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | src/mga_driver.c | 25 |
2 files changed, 0 insertions, 35 deletions
diff --git a/configure.ac b/configure.ac index 3579e1f..20ec456 100644 --- a/configure.ac +++ b/configure.ac @@ -115,16 +115,6 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [#include "xorg-server.h"]) CFLAGS="$save_CFLAGS" -save_CFLAGS="$CFLAGS" -CFLAGS="$XORG_CFLAGS" -AC_CHECK_DECL(xf86ModeBandwidth, - [AC_DEFINE(HAVE_XF86MODEBANDWIDTH, 1, [Have xf86ModeBandwidth])], - [], - [#include <X11/extensions/randr.h> - #include "xorg-server.h" - #include "xf86Modes.h"]) -CFLAGS="$save_CFLAGS" - if test "x$XSERVER_LIBPCIACCESS" = xyes; then PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) fi diff --git a/src/mga_driver.c b/src/mga_driver.c index 18b2f89..720e98e 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -52,9 +52,7 @@ #include "xf86.h" #include "xf86_OSproc.h" -#ifdef HAVE_XF86MODEBANDWIDTH #include "xf86Modes.h" -#endif /* All drivers need this */ @@ -3822,29 +3820,6 @@ MGAFreeScreen(FREE_SCREEN_ARGS_DECL) } -#ifndef HAVE_XF86MODEBANDWIDTH - -#define MODE_BANDWIDTH MODE_BAD - -/** Calculates the memory bandwidth (in MiB/sec) of a mode. */ -static unsigned int -xf86ModeBandwidth(DisplayModePtr mode, int depth) -{ - float a_active, a_total, active_percent, pixels_per_second; - int bytes_per_pixel = (depth + 7) / 8; - - if (!mode->HTotal || !mode->VTotal || !mode->Clock) - return 0; - - a_active = mode->HDisplay * mode->VDisplay; - a_total = mode->HTotal * mode->VTotal; - active_percent = a_active / a_total; - pixels_per_second = active_percent * mode->Clock * 1000.0; - - return (unsigned int)(pixels_per_second * bytes_per_pixel / (1024 * 1024)); -} -#endif - /* Checks if a mode is suitable for the selected chipset. */ /* Optional */ |