Hello,

X1 gen5 continues to work fine.
X1 gen9 x11 stopped crashing and is now usable!  (Tiger lake)

Thank you!
Eric

On Thu, 8 Jul 2021 at 09:41, Jonathan Gray <j...@jsg.id.au> wrote:
>
> The latest xf86-video-amdgpu release was in 2019.
>
> xf86-video-amdgpu-19.1.0..origin/master
>
> minus commits we already have
> cb27a5b Handle NULL fb_ptr in pixmap_get_fb
> e2cd67a Bail from amdgpu_pixmap_get_handle with ShadowFB
> edcbe5f Fix link failure with gcc 10
>
> With a X_PRIVSEP path added to amdgpu_probe.c to handle the change from
> drmOpen() to open().
>
> aedbf47 Include xf86drm.h instead of sarea.h
> 6ed4863 Drop dri.h includes
> 6234a1b Fix drmmode_crtc_scanout_create logic
> 6bd3dc6 Check for AMDGPU_CREATE_PIXMAP_SCANOUT in amdgpu_glamor_create_pixmap
> 2202cdf Replace a few more instances of "master"
> 0d1d479 Fix build against ABI_VIDEODRV_VERSION 25.2
> 442efe7 Make drmmode_crtc_scanout_create/destroy static
> 99f3c82 Drop struct drmmode_scanout altogether in favour of PixmapPtrs
> cfce4b3 Drop bo/width/height members from struct drmmode_scanout
> 680b9a2 Fix return value check of drmIoctl()
> e923642 gitlab CI: update to use the latest CI templates
> 0732f81 glamor: Make pixmap scanout compatible if its dimensions are
> 42a3148 Factor out common code to amdgpu_probe()
> eeaaf37 Introduce amdgpu_device_setup helper
> 1c9742e Kill off drmOpen/Close/drmSetInterfaceVersion in favour of drmDevices
> 2dd7307 Use the device_id straight from gpu_info
> 655b3c5 Reuse the existing busid string
> b357a84 Store the busid string in AMDGPUEnt
> 2c0c154 Remove NULL check after a "cannot fail" function
> 16ae0d0 Fixup the amdgpu_bus_id() string format
> abbe23f Remove drmCheckModesettingSupported and kernel module loading, on 
> Linux
> 0b3bc7a Use ODEV_ATTRIB_PATH where possible for the device node.
> fd66f5c kms: Handle changes to SourceValidate call chain in xserver 19
>
> Index: driver/xf86-video-amdgpu/Makefile.in
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/Makefile.in,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile.in
> --- driver/xf86-video-amdgpu/Makefile.in        16 Apr 2019 01:59:34 -0000    
>   1.2
> +++ driver/xf86-video-amdgpu/Makefile.in        8 Jul 2021 07:13:57 -0000
> @@ -314,6 +314,7 @@ pdfdir = @pdfdir@
>  prefix = @prefix@
>  program_transform_name = @program_transform_name@
>  psdir = @psdir@
> +runstatedir = @runstatedir@
>  sbindir = @sbindir@
>  sharedstatedir = @sharedstatedir@
>  srcdir = @srcdir@
> Index: driver/xf86-video-amdgpu/README.md
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/README.md,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 README.md
> --- driver/xf86-video-amdgpu/README.md  16 Apr 2019 01:49:01 -0000      
> 1.1.1.1
> +++ driver/xf86-video-amdgpu/README.md  7 Jul 2021 13:42:19 -0000
> @@ -9,7 +9,7 @@ Please
>  to the Xorg bugzilla.
>
>  The
> -[master development code 
> repository](https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu)
> +[main development code 
> repository](https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu)
>  can be found at FreeDesktop Gitlab.
>
>  Please use merge requests for patch submission.
> Index: driver/xf86-video-amdgpu/aclocal.m4
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/aclocal.m4,v
> retrieving revision 1.2
> diff -u -p -r1.2 aclocal.m4
> --- driver/xf86-video-amdgpu/aclocal.m4 16 Apr 2019 01:59:34 -0000      1.2
> +++ driver/xf86-video-amdgpu/aclocal.m4 8 Jul 2021 07:13:54 -0000
> @@ -19,9 +19,9 @@ You have another version of autoconf.  I
>  If you have problems, you may need to regenerate the build system entirely.
>  To do so, use the procedure documented by the package, typically 
> 'autoreconf'.])])
>
> -dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
> -dnl serial 11 (pkg-config-0.29.1)
> -dnl
> +# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
> +# serial 12 (pkg-config-0.29.2)
> +
>  dnl Copyright Š 2004 Scott James Remnant <sc...@netsplit.com>.
>  dnl Copyright Š 2012-2015 Dan Nicholson <dbn.li...@gmail.com>
>  dnl
> @@ -62,7 +62,7 @@ dnl
>  dnl See the "Since" comment for each macro you use to see what version
>  dnl of the macros you require.
>  m4_defun([PKG_PREREQ],
> -[m4_define([PKG_MACROS_VERSION], [0.29.1])
> +[m4_define([PKG_MACROS_VERSION], [0.29.2])
>  m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
>      [m4_fatal([pkg.m4 version $1 or higher is required but 
> ]PKG_MACROS_VERSION[ found])])
>  ])dnl PKG_PREREQ
> @@ -163,7 +163,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler fl
>  AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
>
>  pkg_failed=no
> -AC_MSG_CHECKING([for $1])
> +AC_MSG_CHECKING([for $2])
>
>  _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
>  _PKG_CONFIG([$1][_LIBS], [libs], [$2])
> @@ -173,11 +173,11 @@ and $1[]_LIBS to avoid the need to call
>  See the pkg-config man page for more details.])
>
>  if test $pkg_failed = yes; then
> -       AC_MSG_RESULT([no])
> +        AC_MSG_RESULT([no])
>          _PKG_SHORT_ERRORS_SUPPORTED
>          if test $_pkg_short_errors_supported = yes; then
>                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
> --cflags --libs "$2" 2>&1`
> -        else
> +        else
>                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
> "$2" 2>&1`
>          fi
>         # Put the nasty error message in config.log where it belongs
> @@ -194,7 +194,7 @@ installed software in a non-standard pre
>  _PKG_TEXT])[]dnl
>          ])
>  elif test $pkg_failed = untried; then
> -       AC_MSG_RESULT([no])
> +        AC_MSG_RESULT([no])
>         m4_default([$4], [AC_MSG_FAILURE(
>  [The pkg-config script could not be found or is too old.  Make sure it
>  is in your PATH or set the PKG_CONFIG environment variable to the full
> Index: driver/xf86-video-amdgpu/configure
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/configure,v
> retrieving revision 1.3
> diff -u -p -r1.3 configure
> --- driver/xf86-video-amdgpu/configure  26 Oct 2019 09:36:38 -0000      1.3
> +++ driver/xf86-video-amdgpu/configure  8 Jul 2021 07:13:56 -0000
> @@ -784,6 +784,7 @@ infodir
>  docdir
>  oldincludedir
>  includedir
> +runstatedir
>  localstatedir
>  sharedstatedir
>  sysconfdir
> @@ -892,6 +893,7 @@ datadir='${datarootdir}'
>  sysconfdir='${prefix}/etc'
>  sharedstatedir='${prefix}/com'
>  localstatedir='${prefix}/var'
> +runstatedir='${localstatedir}/run'
>  includedir='${prefix}/include'
>  oldincludedir='/usr/include'
>  docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
> @@ -1144,6 +1146,15 @@ do
>    | -silent | --silent | --silen | --sile | --sil)
>      silent=yes ;;
>
> +  -runstatedir | --runstatedir | --runstatedi | --runstated \
> +  | --runstate | --runstat | --runsta | --runst | --runs \
> +  | --run | --ru | --r)
> +    ac_prev=runstatedir ;;
> +  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
> +  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
> +  | --run=* | --ru=* | --r=*)
> +    runstatedir=$ac_optarg ;;
> +
>    -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
>      ac_prev=sbindir ;;
>    -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
> @@ -1281,7 +1292,7 @@ fi
>  for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
>                 datadir sysconfdir sharedstatedir localstatedir includedir \
>                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
> -               libdir localedir mandir
> +               libdir localedir mandir runstatedir
>  do
>    eval ac_val=\$$ac_var
>    # Remove trailing slashes.
> @@ -1434,6 +1445,7 @@ Fine tuning of the installation director
>    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
>    --sharedstatedir=DIR    modifiable architecture-independent data 
> [PREFIX/com]
>    --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
> +  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
>    --libdir=DIR            object code libraries [EPREFIX/lib]
>    --includedir=DIR        C header files [PREFIX/include]
>    --oldincludedir=DIR     C header files for non-gcc [/usr/include]
> @@ -18296,8 +18308,8 @@ $as_echo "$_EXT_CHECK" >&6; }
>  # Checks for libraries.
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDRM" >&5
> -$as_echo_n "checking for LIBDRM... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdrm >= 2.4.89" >&5
> +$as_echo_n "checking for libdrm >= 2.4.89... " >&6; }
>
>  if test -n "$LIBDRM_CFLAGS"; then
>      pkg_cv_LIBDRM_CFLAGS="$LIBDRM_CFLAGS"
> @@ -18337,7 +18349,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -18364,7 +18376,7 @@ Alternatively, you may set the environme
>  and LIBDRM_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> @@ -18387,8 +18399,8 @@ $as_echo "yes" >&6; }
>  fi
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDRM_AMDGPU" >&5
> -$as_echo_n "checking for LIBDRM_AMDGPU... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdrm_amdgpu >= 
> 2.4.76" >&5
> +$as_echo_n "checking for libdrm_amdgpu >= 2.4.76... " >&6; }
>
>  if test -n "$LIBDRM_AMDGPU_CFLAGS"; then
>      pkg_cv_LIBDRM_AMDGPU_CFLAGS="$LIBDRM_AMDGPU_CFLAGS"
> @@ -18428,7 +18440,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -18455,7 +18467,7 @@ Alternatively, you may set the environme
>  and LIBDRM_AMDGPU_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> @@ -18478,8 +18490,8 @@ $as_echo "yes" >&6; }
>  fi
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GBM" >&5
> -$as_echo_n "checking for GBM... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gbm" >&5
> +$as_echo_n "checking for gbm... " >&6; }
>
>  if test -n "$GBM_CFLAGS"; then
>      pkg_cv_GBM_CFLAGS="$GBM_CFLAGS"
> @@ -18519,7 +18531,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -18546,7 +18558,7 @@ Alternatively, you may set the environme
>  and GBM_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> @@ -18571,8 +18583,8 @@ fi
>  # Obtain compiler/linker options for the driver dependencies
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XORG" >&5
> -$as_echo_n "checking for XORG... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xorg-server >= 1.13 
> xproto fontsproto xf86driproto $REQUIRED_MODULES" >&5
> +$as_echo_n "checking for xorg-server >= 1.13 xproto fontsproto xf86driproto 
> $REQUIRED_MODULES... " >&6; }
>
>  if test -n "$XORG_CFLAGS"; then
>      pkg_cv_XORG_CFLAGS="$XORG_CFLAGS"
> @@ -18612,7 +18624,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -18639,7 +18651,7 @@ Alternatively, you may set the environme
>  and XORG_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> @@ -18662,8 +18674,8 @@ $as_echo "yes" >&6; }
>  fi
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEXT" >&5
> -$as_echo_n "checking for XEXT... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xextproto >= 7.0.99.1" 
> >&5
> +$as_echo_n "checking for xextproto >= 7.0.99.1... " >&6; }
>
>  if test -n "$XEXT_CFLAGS"; then
>      pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS"
> @@ -18703,7 +18715,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -18721,7 +18733,7 @@ fi
>
>         HAVE_XEXTPROTO_71="no"
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         HAVE_XEXTPROTO_71="no"
>  else
> @@ -18783,8 +18795,8 @@ fi
>  if test "x$enable_udev" != "xno"; then
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5
> -$as_echo_n "checking for LIBUDEV... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libudev" >&5
> +$as_echo_n "checking for libudev... " >&6; }
>
>  if test -n "$LIBUDEV_CFLAGS"; then
>      pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS"
> @@ -18824,7 +18836,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -18842,7 +18854,7 @@ fi
>
>         LIBUDEV=no
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         LIBUDEV=no
>  else
> @@ -18940,8 +18952,8 @@ $as_echo "#define HAVE_GLAMOR_FINISH 1"
>  else
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGL" >&5
> -$as_echo_n "checking for LIBGL... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gl" >&5
> +$as_echo_n "checking for gl... " >&6; }
>
>  if test -n "$LIBGL_CFLAGS"; then
>      pkg_cv_LIBGL_CFLAGS="$LIBGL_CFLAGS"
> @@ -18981,7 +18993,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -19008,7 +19020,7 @@ Alternatively, you may set the environme
>  and LIBGL_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> @@ -19036,8 +19048,8 @@ fi
>         if test "x$GLAMOR_XSERVER" != xyes; then
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGLAMOR" >&5
> -$as_echo_n "checking for LIBGLAMOR... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glamor >= 0.6.0" >&5
> +$as_echo_n "checking for glamor >= 0.6.0... " >&6; }
>
>  if test -n "$LIBGLAMOR_CFLAGS"; then
>      pkg_cv_LIBGLAMOR_CFLAGS="$LIBGLAMOR_CFLAGS"
> @@ -19077,7 +19089,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -19104,7 +19116,7 @@ Alternatively, you may set the environme
>  and LIBGLAMOR_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> @@ -19127,8 +19139,8 @@ $as_echo "yes" >&6; }
>  fi
>
>  pkg_failed=no
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGLAMOR_EGL" >&5
> -$as_echo_n "checking for LIBGLAMOR_EGL... " >&6; }
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glamor-egl" >&5
> +$as_echo_n "checking for glamor-egl... " >&6; }
>
>  if test -n "$LIBGLAMOR_EGL_CFLAGS"; then
>      pkg_cv_LIBGLAMOR_EGL_CFLAGS="$LIBGLAMOR_EGL_CFLAGS"
> @@ -19168,7 +19180,7 @@ fi
>
>
>  if test $pkg_failed = yes; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>
>  if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> @@ -19195,7 +19207,7 @@ Alternatively, you may set the environme
>  and LIBGLAMOR_EGL_LIBS to avoid the need to call pkg-config.
>  See the pkg-config man page for more details." "$LINENO" 5
>  elif test $pkg_failed = untried; then
> -       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
>  $as_echo "no" >&6; }
>         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
>  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> Index: driver/xf86-video-amdgpu/conf/Makefile.in
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/conf/Makefile.in,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile.in
> --- driver/xf86-video-amdgpu/conf/Makefile.in   16 Apr 2019 01:59:34 -0000    
>   1.2
> +++ driver/xf86-video-amdgpu/conf/Makefile.in   8 Jul 2021 07:13:57 -0000
> @@ -284,6 +284,7 @@ pdfdir = @pdfdir@
>  prefix = @prefix@
>  program_transform_name = @program_transform_name@
>  psdir = @psdir@
> +runstatedir = @runstatedir@
>  sbindir = @sbindir@
>  sharedstatedir = @sharedstatedir@
>  srcdir = @srcdir@
> Index: driver/xf86-video-amdgpu/man/Makefile.in
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/man/Makefile.in,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile.in
> --- driver/xf86-video-amdgpu/man/Makefile.in    16 Apr 2019 01:59:34 -0000    
>   1.2
> +++ driver/xf86-video-amdgpu/man/Makefile.in    8 Jul 2021 07:13:57 -0000
> @@ -285,6 +285,7 @@ pdfdir = @pdfdir@
>  prefix = @prefix@
>  program_transform_name = @program_transform_name@
>  psdir = @psdir@
> +runstatedir = @runstatedir@
>  sbindir = @sbindir@
>  sharedstatedir = @sharedstatedir@
>  srcdir = @srcdir@
> Index: driver/xf86-video-amdgpu/man/amdgpu.man
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/man/amdgpu.man,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 amdgpu.man
> --- driver/xf86-video-amdgpu/man/amdgpu.man     16 Apr 2019 01:49:36 -0000    
>   1.1.1.1
> +++ driver/xf86-video-amdgpu/man/amdgpu.man     7 Jul 2021 13:42:19 -0000
> @@ -81,7 +81,7 @@ on. If this option is set, the default v
>  accordingly. If this option isn't set, the default value of the property is
>  .B auto,
>  which means that TearFree is on for rotated outputs, outputs with RandR
> -transforms applied and for RandR 1.4 slave outputs, otherwise off.
> +transforms applied and for RandR 1.4 secondary outputs, otherwise off.
>  .TP
>  .BI "Option \*qVariableRefresh\*q \*q" boolean \*q
>  Enables support for enabling variable refresh on the Screen's CRTCs
> Index: driver/xf86-video-amdgpu/src/Makefile.in
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/Makefile.in,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile.in
> --- driver/xf86-video-amdgpu/src/Makefile.in    16 Apr 2019 01:59:34 -0000    
>   1.2
> +++ driver/xf86-video-amdgpu/src/Makefile.in    8 Jul 2021 07:13:58 -0000
> @@ -333,6 +333,7 @@ pdfdir = @pdfdir@
>  prefix = @prefix@
>  program_transform_name = @program_transform_name@
>  psdir = @psdir@
> +runstatedir = @runstatedir@
>  sbindir = @sbindir@
>  sharedstatedir = @sharedstatedir@
>  srcdir = @srcdir@
> Index: driver/xf86-video-amdgpu/src/amdgpu_bo_helper.c
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_bo_helper.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 amdgpu_bo_helper.c
> --- driver/xf86-video-amdgpu/src/amdgpu_bo_helper.c     26 Oct 2020 14:15:50 
> -0000      1.2
> +++ driver/xf86-video-amdgpu/src/amdgpu_bo_helper.c     7 Jul 2021 13:42:19 
> -0000
> @@ -79,7 +79,7 @@ struct amdgpu_buffer *amdgpu_alloc_pixma
>                 }
>                 pixmap_buffer->ref_count = 1;
>
> -               if ( bitsPerPixel == pScrn->bitsPerPixel)
> +               if (usage_hint & AMDGPU_CREATE_PIXMAP_SCANOUT)
>                         bo_use |= GBM_BO_USE_SCANOUT;
>
>  #ifdef HAVE_GBM_BO_USE_LINEAR
> Index: driver/xf86-video-amdgpu/src/amdgpu_dri3.c
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_dri3.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 amdgpu_dri3.c
> --- driver/xf86-video-amdgpu/src/amdgpu_dri3.c  21 Dec 2020 09:06:14 -0000    
>   1.3
> +++ driver/xf86-video-amdgpu/src/amdgpu_dri3.c  7 Jul 2021 13:42:19 -0000
> @@ -47,7 +47,7 @@ extern int priv_open_device(const char *
>  #define priv_open_device(n)    open(n,O_RDWR|O_CLOEXEC)
>  #endif
>
> -static int open_master_node(ScreenPtr screen, int *out)
> +static int open_card_node(ScreenPtr screen, int *out)
>  {
>         ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
>         AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
> @@ -118,7 +118,7 @@ amdgpu_dri3_open(ScreenPtr screen, RRPro
>                 ret = open_render_node(screen, out);
>
>         if (ret != Success)
> -               ret = open_master_node(screen, out);
> +               ret = open_card_node(screen, out);
>
>         return ret;
>  }
> Index: driver/xf86-video-amdgpu/src/amdgpu_drv.h
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_drv.h,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 amdgpu_drv.h
> --- driver/xf86-video-amdgpu/src/amdgpu_drv.h   16 Apr 2019 01:49:41 -0000    
>   1.1.1.1
> +++ driver/xf86-video-amdgpu/src/amdgpu_drv.h   7 Jul 2021 13:42:19 -0000
> @@ -168,18 +168,18 @@ typedef enum {
>  } AMDGPUOpts;
>
>  static inline ScreenPtr
> -amdgpu_master_screen(ScreenPtr screen)
> +amdgpu_primary_screen(ScreenPtr screen)
>  {
> -       if (screen->current_master)
> -               return screen->current_master;
> +       if (screen->current_primary)
> +               return screen->current_primary;
>
>         return screen;
>  }
>
>  static inline ScreenPtr
> -amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty)
> +amdgpu_dirty_primary(PixmapDirtyUpdatePtr dirty)
>  {
> -       return amdgpu_master_screen(dirty->slave_dst->drawable.pScreen);
> +       return amdgpu_primary_screen(dirty->secondary_dst->drawable.pScreen);
>  }
>
>  static inline DrawablePtr
> @@ -248,8 +248,6 @@ extern DevScreenPrivateKeyRec amdgpu_dev
>
>  typedef struct {
>         EntityInfoPtr pEnt;
> -       struct pci_device *PciInfo;
> -       int Chipset;
>         uint32_t family;
>         struct gbm_device *gbm;
>
> Index: driver/xf86-video-amdgpu/src/amdgpu_glamor.c
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_glamor.c,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 amdgpu_glamor.c
> --- driver/xf86-video-amdgpu/src/amdgpu_glamor.c        16 Apr 2019 01:49:36 
> -0000      1.1.1.1
> +++ driver/xf86-video-amdgpu/src/amdgpu_glamor.c        7 Jul 2021 13:42:19 
> -0000
> @@ -201,14 +201,16 @@ amdgpu_glamor_create_pixmap(ScreenPtr sc
>                             unsigned usage)
>  {
>         ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> +       PixmapFormatPtr format = xf86GetPixFormat(scrn, depth);
>         AMDGPUInfoPtr info = AMDGPUPTR(scrn);
>         struct amdgpu_pixmap *priv;
>         PixmapPtr pixmap, new_pixmap = NULL;
>
> -       if (!xf86GetPixFormat(scrn, depth))
> +       if (!format)
>                 return NULL;
>
> -       if (!AMDGPU_CREATE_PIXMAP_SHARED(usage)) {
> +       if (!(usage & AMDGPU_CREATE_PIXMAP_SCANOUT) &&
> +           !AMDGPU_CREATE_PIXMAP_SHARED(usage)) {
>                 if (info->shadow_primary) {
>                         if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP)
>                                 return fbCreatePixmap(screen, w, h, depth, 
> usage);
> @@ -216,9 +218,15 @@ amdgpu_glamor_create_pixmap(ScreenPtr sc
>                         usage |= AMDGPU_CREATE_PIXMAP_LINEAR |
>                                  AMDGPU_CREATE_PIXMAP_GTT;
>                 } else if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) {
> -                       pixmap = glamor_create_pixmap(screen, w, h, depth, 
> usage);
> -                       if (pixmap)
> -                               return pixmap;
> +                       if (w < scrn->virtualX || w > scrn->displayWidth ||
> +                           h != scrn->virtualY ||
> +                           format->bitsPerPixel != scrn->bitsPerPixel) {
> +                               pixmap = glamor_create_pixmap(screen, w, h, 
> depth, usage);
> +                               if (pixmap)
> +                                       return pixmap;
> +                       } else {
> +                               usage |= AMDGPU_CREATE_PIXMAP_SCANOUT;
> +                       }
>                 }
>         }
>
> @@ -342,7 +350,7 @@ amdgpu_glamor_set_pixmap_bo(DrawablePtr
>
>
>  static Bool
> -amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave,
> +amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr secondary,
>                                    void **handle_p)
>  {
>         ScreenPtr screen = pixmap->drawable.pScreen;
> Index: driver/xf86-video-amdgpu/src/amdgpu_kms.c
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_kms.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 amdgpu_kms.c
> --- driver/xf86-video-amdgpu/src/amdgpu_kms.c   26 Oct 2019 09:36:38 -0000    
>   1.2
> +++ driver/xf86-video-amdgpu/src/amdgpu_kms.c   7 Jul 2021 13:42:19 -0000
> @@ -283,6 +283,7 @@ static void AMDGPUFreeRec(ScrnInfoPtr pS
>                         amdgpu_unwrap_property_requests(pScrn);
>                         amdgpu_device_deinitialize(pAMDGPUEnt->pDev);
>                         amdgpu_kernel_close_fd(pAMDGPUEnt);
> +                       free(pAMDGPUEnt->busid);
>                         free(pPriv->ptr);
>                         pPriv->ptr = NULL;
>                 }
> @@ -519,8 +520,8 @@ amdgpu_sync_scanout_pixmaps(xf86CrtcPtr
>                                                         int scanout_id)
>  {
>         drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
> -       DrawablePtr dst = &drmmode_crtc->scanout[scanout_id].pixmap->drawable;
> -       DrawablePtr src = &drmmode_crtc->scanout[scanout_id ^ 
> 1].pixmap->drawable;
> +       DrawablePtr dst = &drmmode_crtc->scanout[scanout_id]->drawable;
> +       DrawablePtr src = &drmmode_crtc->scanout[scanout_id ^ 1]->drawable;
>         RegionPtr last_region = &drmmode_crtc->scanout_last_region;
>         ScrnInfoPtr scrn = xf86_crtc->scrn;
>         ScreenPtr pScreen = scrn->pScreen;
> @@ -603,8 +604,8 @@ dirty_region(PixmapDirtyUpdatePtr dirty)
>         if (dirty->rotation != RR_Rotate_0) {
>                 dstregion = transform_region(damageregion,
>                                              &dirty->f_inverse,
> -                                            dirty->slave_dst->drawable.width,
> -                                            
> dirty->slave_dst->drawable.height);
> +                                            
> dirty->secondary_dst->drawable.width,
> +                                            
> dirty->secondary_dst->drawable.height);
>         } else
>  #endif
>         {
> @@ -612,7 +613,7 @@ dirty_region(PixmapDirtyUpdatePtr dirty)
>
>                 dstregion = RegionDuplicate(damageregion);
>                 RegionTranslate(dstregion, -dirty->x, -dirty->y);
> -               PixmapRegionInit(&pixregion, dirty->slave_dst);
> +               PixmapRegionInit(&pixregion, dirty->secondary_dst);
>                 RegionIntersect(dstregion, dstregion, &pixregion);
>                 RegionUninit(&pixregion);
>         }
> @@ -629,8 +630,8 @@ redisplay_dirty(PixmapDirtyUpdatePtr dir
>         if (RegionNil(region))
>                 goto out;
>
> -       if (dirty->slave_dst->master_pixmap)
> -               DamageRegionAppend(&dirty->slave_dst->drawable, region);
> +       if (dirty->secondary_dst->primary_pixmap)
> +               DamageRegionAppend(&dirty->secondary_dst->drawable, region);
>
>  #ifdef HAS_DIRTYTRACKING_ROTATION
>         PixmapSyncDirtyHelper(dirty);
> @@ -639,8 +640,8 @@ redisplay_dirty(PixmapDirtyUpdatePtr dir
>  #endif
>
>         amdgpu_glamor_flush(src_scrn);
> -       if (dirty->slave_dst->master_pixmap)
> -               DamageRegionProcessPending(&dirty->slave_dst->drawable);
> +       if (dirty->secondary_dst->primary_pixmap)
> +               DamageRegionProcessPending(&dirty->secondary_dst->drawable);
>
>  out:
>         DamageEmpty(dirty->damage);
> @@ -657,12 +658,12 @@ amdgpu_prime_scanout_update_abort(xf86Cr
>  void
>  amdgpu_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)
>  {
> -       ScreenPtr master_screen = amdgpu_dirty_master(dirty);
> +       ScreenPtr primary_screen = amdgpu_dirty_primary(dirty);
>         PixmapDirtyUpdatePtr ent;
>         RegionPtr region;
>
> -       xorg_list_for_each_entry(ent, &master_screen->pixmap_dirty_list, ent) 
> {
> -               if (!amdgpu_dirty_src_equals(dirty, ent->slave_dst))
> +       xorg_list_for_each_entry(ent, &primary_screen->pixmap_dirty_list, 
> ent) {
> +               if (!amdgpu_dirty_src_equals(dirty, ent->secondary_dst))
>                         continue;
>
>                 region = dirty_region(ent);
> @@ -675,45 +676,45 @@ amdgpu_sync_shared_pixmap(PixmapDirtyUpd
>  #if HAS_SYNC_SHARED_PIXMAP
>
>  static Bool
> -master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
> +primary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
>  {
> -       ScreenPtr master_screen = amdgpu_dirty_master(dirty);
> +       ScreenPtr primary_screen = amdgpu_dirty_primary(dirty);
>
> -       return master_screen->SyncSharedPixmap != NULL;
> +       return primary_screen->SyncSharedPixmap != NULL;
>  }
>
>  static Bool
> -slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
> +secondary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr 
> dirty)
>  {
> -       ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen;
> +       ScreenPtr secondary_screen = dirty->secondary_dst->drawable.pScreen;
>
> -       return slave_screen->SyncSharedPixmap != NULL;
> +       return secondary_screen->SyncSharedPixmap != NULL;
>  }
>
>  static void
>  call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)
>  {
> -       ScreenPtr master_screen = amdgpu_dirty_master(dirty);
> +       ScreenPtr primary_screen = amdgpu_dirty_primary(dirty);
>
> -       master_screen->SyncSharedPixmap(dirty);
> +       primary_screen->SyncSharedPixmap(dirty);
>  }
>
>  #else /* !HAS_SYNC_SHARED_PIXMAP */
>
>  static Bool
> -master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
> +primary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
>  {
> -       ScrnInfoPtr master_scrn = 
> xf86ScreenToScrn(amdgpu_dirty_master(dirty));
> +       ScrnInfoPtr primary_scrn = 
> xf86ScreenToScrn(amdgpu_dirty_primary(dirty));
>
> -       return master_scrn->driverName == scrn->driverName;
> +       return primary_scrn->driverName == scrn->driverName;
>  }
>
>  static Bool
> -slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
> +secondary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr 
> dirty)
>  {
> -       ScrnInfoPtr slave_scrn = 
> xf86ScreenToScrn(dirty->slave_dst->drawable.pScreen);
> +       ScrnInfoPtr secondary_scrn = 
> xf86ScreenToScrn(dirty->secondary_dst->drawable.pScreen);
>
> -       return slave_scrn->driverName == scrn->driverName;
> +       return secondary_scrn->driverName == scrn->driverName;
>  }
>
>  static void
> @@ -728,12 +729,12 @@ call_sync_shared_pixmap(PixmapDirtyUpdat
>  static xf86CrtcPtr
>  amdgpu_prime_dirty_to_crtc(PixmapDirtyUpdatePtr dirty)
>  {
> -       ScreenPtr screen = dirty->slave_dst->drawable.pScreen;
> +       ScreenPtr screen = dirty->secondary_dst->drawable.pScreen;
>         ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
>         xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
>         int c;
>
> -       /* Find the CRTC which is scanning out from this slave pixmap */
> +       /* Find the CRTC which is scanning out from this secondary pixmap */
>         for (c = 0; c < xf86_config->num_crtc; c++) {
>                 xf86CrtcPtr xf86_crtc = xf86_config->crtc[c];
>                 drmmode_crtc_private_ptr drmmode_crtc = 
> xf86_crtc->driver_private;
> @@ -758,7 +759,7 @@ amdgpu_prime_scanout_do_update(xf86CrtcP
>                 if (amdgpu_dirty_src_equals(dirty, 
> drmmode_crtc->prime_scanout_pixmap)) {
>                         RegionPtr region;
>
> -                       if (master_has_sync_shared_pixmap(scrn, dirty))
> +                       if (primary_has_sync_shared_pixmap(scrn, dirty))
>                                 call_sync_shared_pixmap(dirty);
>
>                         region = dirty_region(dirty);
> @@ -771,7 +772,7 @@ amdgpu_prime_scanout_do_update(xf86CrtcP
>                                 amdgpu_glamor_flush(scrn);
>                                 
> RegionCopy(&drmmode_crtc->scanout_last_region, region);
>                                 RegionTranslate(region, -crtc->x, -crtc->y);
> -                               dirty->slave_dst = 
> drmmode_crtc->scanout[scanout_id].pixmap;
> +                               dirty->secondary_dst = 
> drmmode_crtc->scanout[scanout_id];
>                         }
>
>                         redisplay_dirty(dirty, region);
> @@ -798,7 +799,7 @@ amdgpu_prime_scanout_update_handler(xf86
>  static void
>  amdgpu_prime_scanout_update(PixmapDirtyUpdatePtr dirty)
>  {
> -       ScreenPtr screen = dirty->slave_dst->drawable.pScreen;
> +       ScreenPtr screen = dirty->secondary_dst->drawable.pScreen;
>         ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
>         AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
>         xf86CrtcPtr xf86_crtc = amdgpu_prime_dirty_to_crtc(dirty);
> @@ -810,7 +811,7 @@ amdgpu_prime_scanout_update(PixmapDirtyU
>
>         drmmode_crtc = xf86_crtc->driver_private;
>         if (drmmode_crtc->scanout_update_pending ||
> -           !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap ||
> +           !drmmode_crtc->scanout[drmmode_crtc->scanout_id] ||
>             drmmode_crtc->dpms_mode != DPMSModeOn)
>                 return;
>
> @@ -862,7 +863,7 @@ amdgpu_prime_scanout_update(PixmapDirtyU
>  static void
>  amdgpu_prime_scanout_flip(PixmapDirtyUpdatePtr ent)
>  {
> -       ScreenPtr screen = ent->slave_dst->drawable.pScreen;
> +       ScreenPtr screen = ent->secondary_dst->drawable.pScreen;
>         ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
>         AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
>         xf86CrtcPtr crtc = amdgpu_prime_dirty_to_crtc(ent);
> @@ -877,14 +878,14 @@ amdgpu_prime_scanout_flip(PixmapDirtyUpd
>         drmmode_crtc = crtc->driver_private;
>         scanout_id = drmmode_crtc->scanout_id ^ 1;
>         if (drmmode_crtc->scanout_update_pending ||
> -           !drmmode_crtc->scanout[scanout_id].pixmap ||
> +           !drmmode_crtc->scanout[scanout_id] ||
>             drmmode_crtc->dpms_mode != DPMSModeOn)
>                 return;
>
>         if (!amdgpu_prime_scanout_do_update(crtc, scanout_id))
>                 return;
>
> -       fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
> +       fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id]);
>         if (!fb) {
>                 xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>                            "Failed to get FB for PRIME flip.\n");
> @@ -937,11 +938,11 @@ amdgpu_dirty_update(ScrnInfoPtr scrn)
>                 if (screen->isGPU) {
>                         PixmapDirtyUpdatePtr region_ent = ent;
>
> -                       if (master_has_sync_shared_pixmap(scrn, ent)) {
> -                               ScreenPtr master_screen = 
> amdgpu_dirty_master(ent);
> +                       if (primary_has_sync_shared_pixmap(scrn, ent)) {
> +                               ScreenPtr primary_screen = 
> amdgpu_dirty_primary(ent);
>
> -                               xorg_list_for_each_entry(region_ent, 
> &master_screen->pixmap_dirty_list, ent) {
> -                                       if (amdgpu_dirty_src_equals(ent, 
> region_ent->slave_dst))
> +                               xorg_list_for_each_entry(region_ent, 
> &primary_screen->pixmap_dirty_list, ent) {
> +                                       if (amdgpu_dirty_src_equals(ent, 
> region_ent->secondary_dst))
>                                                 break;
>                                 }
>                         }
> @@ -965,7 +966,7 @@ amdgpu_dirty_update(ScrnInfoPtr scrn)
>
>                         RegionDestroy(region);
>                 } else {
> -                       if (slave_has_sync_shared_pixmap(scrn, ent))
> +                       if (secondary_has_sync_shared_pixmap(scrn, ent))
>                                 continue;
>
>                         region = dirty_region(ent);
> @@ -975,6 +976,11 @@ amdgpu_dirty_update(ScrnInfoPtr scrn)
>         }
>  }
>
> +static void
> +amdgpuSourceValidate(DrawablePtr draw, int x, int y, int w, int h,
> +                    unsigned int subWindowMode)
> +{
> +}
>
>  Bool
>  amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
> @@ -987,11 +993,11 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf8
>         DrawablePtr pDraw;
>
>         if (!xf86_crtc->enabled ||
> -           !drmmode_crtc->scanout[scanout_id].pixmap ||
> +           !drmmode_crtc->scanout[scanout_id] ||
>             extents.x1 >= extents.x2 || extents.y1 >= extents.y2)
>                 return FALSE;
>
> -       pDraw = &drmmode_crtc->scanout[scanout_id].pixmap->drawable;
> +       pDraw = &drmmode_crtc->scanout[scanout_id]->drawable;
>         if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents))
>                 return FALSE;
>
> @@ -1031,7 +1037,7 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf8
>                         SetPicturePictFilter(src, xf86_crtc->filter, 
> xf86_crtc->params,
>                                              xf86_crtc->nparams);
>
> -               pScreen->SourceValidate = NULL;
> +               pScreen->SourceValidate = amdgpuSourceValidate;
>                 CompositePicture(PictOpSrc,
>                                  src, NULL, dst,
>                                  extents.x1, extents.y1, 0, 0, extents.x1,
> @@ -1192,7 +1198,7 @@ amdgpu_scanout_flip(ScreenPtr pScreen, A
>         amdgpu_glamor_flush(scrn);
>         RegionEmpty(region);
>
> -       fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
> +       fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id]);
>         if (!fb) {
>                 xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>                            "Failed to get FB for scanout flip.\n");
> @@ -1225,8 +1231,7 @@ amdgpu_scanout_flip(ScreenPtr pScreen, A
>                            &drmmode_crtc->scanout_last_region);
>                 RegionEmpty(&drmmode_crtc->scanout_last_region);
>                 amdgpu_scanout_update(xf86_crtc);
> -               drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode,
> -                                            
> &drmmode_crtc->scanout[scanout_id]);
> +               
> drmmode_crtc_scanout_destroy(&drmmode_crtc->scanout[scanout_id]);
>                 drmmode_crtc->tear_free = FALSE;
>                 return;
>         }
> @@ -1252,7 +1257,7 @@ static void AMDGPUBlockHandler_KMS(BLOCK
>         (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
>         pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
>
> -       if (!xf86ScreenToScrn(amdgpu_master_screen(pScreen))->vtSema)
> +       if (!xf86ScreenToScrn(amdgpu_primary_screen(pScreen))->vtSema)
>                 return;
>
>         if (!pScreen->isGPU)
> @@ -1261,12 +1266,12 @@ static void AMDGPUBlockHandler_KMS(BLOCK
>                         xf86CrtcPtr crtc = xf86_config->crtc[c];
>                         drmmode_crtc_private_ptr drmmode_crtc = 
> crtc->driver_private;
>
> -                       if (drmmode_crtc->rotate.pixmap)
> +                       if (drmmode_crtc->rotate)
>                                 continue;
>
>                         if (drmmode_crtc->tear_free)
>                                 amdgpu_scanout_flip(pScreen, info, crtc);
> -                       else if 
> (drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
> +                       else if 
> (drmmode_crtc->scanout[drmmode_crtc->scanout_id])
>                                 amdgpu_scanout_update(crtc);
>                 }
>         }
> @@ -1415,20 +1420,13 @@ static Bool AMDGPUPreInitChipType_KMS(Sc
>         AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
>         AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
>
> -       info->Chipset = info->PciInfo->device_id;
>         pScrn->chipset = (char*)amdgpu_get_marketing_name(pAMDGPUEnt->pDev);
>         if (!pScrn->chipset)
>                 pScrn->chipset = "Unknown AMD Radeon GPU";
>
> -       if (info->Chipset < 0) {
> -               xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -                          "Chipset \"%s\" is not recognized\n",
> -                          pScrn->chipset);
> -               return FALSE;
> -       }
>         xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
>                    "Chipset: \"%s\" (ChipID = 0x%04x)\n",
> -                  pScrn->chipset, info->Chipset);
> +                  pScrn->chipset, gpu_info->asic_id);
>
>         info->family = gpu_info->family_id;
>
> @@ -1570,7 +1568,6 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn
>                 xf86SetPrimInitDone(pScrn->entityList[0]);
>         }
>
> -       info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index);
>         pScrn->monitor = pScrn->confScreen->monitor;
>
>         if (!AMDGPUPreInitVisual(pScrn))
> @@ -1853,7 +1850,7 @@ CARD32 cleanup_black_fb(OsTimerPtr timer
>         xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
>         int c;
>
> -       if (xf86ScreenToScrn(amdgpu_master_screen(screen))->vtSema)
> +       if (xf86ScreenToScrn(amdgpu_primary_screen(screen))->vtSema)
>                 return 0;
>
>         /* Unreference the all-black FB created by AMDGPULeaveVT_KMS. After
> @@ -2209,6 +2206,7 @@ Bool AMDGPUEnterVT_KMS(ScrnInfoPtr pScrn
>                 struct amdgpu_buffer *front_buffer =
>                         amdgpu_alloc_pixmap_bo(pScrn, pScrn->virtualX,
>                                                pScrn->virtualY, pScrn->depth,
> +                                              AMDGPU_CREATE_PIXMAP_SCANOUT |
>                                                AMDGPU_CREATE_PIXMAP_LINEAR,
>                                                pScrn->bitsPerPixel,
>                                                &pitch);
> @@ -2270,7 +2268,6 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn
>         if (!info->shadow_fb) {
>                 AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
>                 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> -               struct drmmode_scanout black_scanout = { .pixmap = NULL, .bo 
> = NULL };
>                 xf86CrtcPtr crtc;
>                 drmmode_crtc_private_ptr drmmode_crtc;
>                 unsigned w = 0, h = 0;
> @@ -2296,11 +2293,15 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn
>
>                 /* Make all active CRTCs scan out from an all-black 
> framebuffer */
>                 if (w > 0 && h > 0) {
> -                       if (drmmode_crtc_scanout_create(crtc, &black_scanout, 
> w, h)) {
> +                       PixmapPtr black_scanout =
> +                               pScreen->CreatePixmap(pScreen, w, h, 
> pScrn->depth,
> +                                                     
> AMDGPU_CREATE_PIXMAP_SCANOUT);
> +
> +                       if (black_scanout) {
>                                 struct drmmode_fb *black_fb =
> -                                       
> amdgpu_pixmap_get_fb(black_scanout.pixmap);
> +                                       amdgpu_pixmap_get_fb(black_scanout);
>
> -                               amdgpu_pixmap_clear(black_scanout.pixmap);
> +                               amdgpu_pixmap_clear(black_scanout);
>                                 amdgpu_glamor_finish(pScrn);
>
>                                 for (i = 0; i < xf86_config->num_crtc; i++) {
> @@ -2319,20 +2320,21 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn
>                                                 }
>
>                                                 if (pScrn->is_gpu) {
> -                                                       if 
> (drmmode_crtc->scanout[0].pixmap)
> -                                                               
> pixmap_unref_fb(drmmode_crtc->scanout[0].pixmap);
> -                                                       if 
> (drmmode_crtc->scanout[1].pixmap)
> -                                                               
> pixmap_unref_fb(drmmode_crtc->scanout[1].pixmap);
> +                                                       if 
> (drmmode_crtc->scanout[0])
> +                                                               
> pixmap_unref_fb(drmmode_crtc->scanout[0]);
> +                                                       if 
> (drmmode_crtc->scanout[1])
> +                                                               
> pixmap_unref_fb(drmmode_crtc->scanout[1]);
>                                                 } else {
>                                                         
> drmmode_crtc_scanout_free(crtc);
>                                                 }
>                                         }
>                                 }
> +
> +                               pScreen->DestroyPixmap(black_scanout);
>                         }
>                 }
>
>                 xf86RotateFreeShadow(pScrn);
> -               drmmode_crtc_scanout_destroy(&info->drmmode, &black_scanout);
>
>                 /* Unreference FBs of all pixmaps. After this, the only FB 
> remaining
>                  * should be the all-black one being scanned out by active 
> CRTCs
> @@ -2415,12 +2417,12 @@ static Bool amdgpu_setup_kernel_mem(Scre
>
>         if (!info->front_buffer) {
>                 int pitch;
> -               int hint = 0;
> +               int hint = AMDGPU_CREATE_PIXMAP_SCANOUT;
>
>                 if (info->shadow_primary)
> -                       hint = AMDGPU_CREATE_PIXMAP_LINEAR | 
> AMDGPU_CREATE_PIXMAP_GTT;
> +                       hint |= AMDGPU_CREATE_PIXMAP_LINEAR | 
> AMDGPU_CREATE_PIXMAP_GTT;
>                 else if (!info->use_glamor)
> -                       hint = AMDGPU_CREATE_PIXMAP_LINEAR;
> +                       hint |= AMDGPU_CREATE_PIXMAP_LINEAR;
>
>                 info->front_buffer =
>                         amdgpu_alloc_pixmap_bo(pScrn, pScrn->virtualX,
> Index: driver/xf86-video-amdgpu/src/amdgpu_probe.c
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_probe.c,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 amdgpu_probe.c
> --- driver/xf86-video-amdgpu/src/amdgpu_probe.c 16 Apr 2019 01:49:39 -0000    
>   1.1.1.1
> +++ driver/xf86-video-amdgpu/src/amdgpu_probe.c 8 Jul 2021 01:24:40 -0000
> @@ -33,6 +33,8 @@
>  #include <errno.h>
>  #include <string.h>
>  #include <stdlib.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
>
>  /*
>   * Authors:
> @@ -48,12 +50,17 @@
>  #include "xf86.h"
>
>  #include "xf86drmMode.h"
> -#include "dri.h"
>
>  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
>  #include <xf86_OSproc.h>
>  #endif
>
> +#ifdef X_PRIVSEP
> +extern int priv_open_device(const char *);
> +#else
> +#define priv_open_device(n)    open(n,O_RDWR|O_CLOEXEC)
> +#endif
> +
>  #include <xf86platformBus.h>
>
>  _X_EXPORT int gAMDGPUEntityIndex = -1;
> @@ -75,36 +82,34 @@ static void AMDGPUIdentify(int flags)
>         xf86PrintChipsets(AMDGPU_NAME, "Driver for AMD Radeon", AMDGPUAny);
>  }
>
> -static char *amdgpu_bus_id(ScrnInfoPtr pScrn, struct pci_device *dev)
> +static Bool amdgpu_device_matches(const drmDevicePtr device,
> +                                 const struct pci_device *dev)
>  {
> -       char *busid;
> -
> -       XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d",
> -                   dev->domain, dev->bus, dev->dev, dev->func);
> -
> -       if (!busid)
> -               xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 0,
> -                              "AMDGPU: Failed to generate bus ID string\n");
> -
> -       return busid;
> +       return (device->bustype == DRM_BUS_PCI &&
> +               device->businfo.pci->domain == dev->domain &&
> +               device->businfo.pci->bus == dev->bus &&
> +               device->businfo.pci->dev == dev->dev &&
> +               device->businfo.pci->func == dev->func);
>  }
>
> -static Bool amdgpu_kernel_mode_enabled(ScrnInfoPtr pScrn, char *busIdString)
> +static Bool amdgpu_kernel_mode_enabled(ScrnInfoPtr pScrn)
>  {
> +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +       AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
> +       const char *busIdString = pAMDGPUEnt->busid;
>         int ret = drmCheckModesettingSupported(busIdString);
>
> -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
>         if (ret) {
>                 if (xf86LoadKernelModule("amdgpukms"))
>                         ret = drmCheckModesettingSupported(busIdString);
>         }
> -#endif
>         if (ret) {
>                 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
>                                "[KMS] drm report modesetting isn't 
> supported.\n");
>                 return FALSE;
>         }
>
> +#endif
>         xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
>                        "[KMS] Kernel modesetting enabled.\n");
>         return TRUE;
> @@ -112,42 +117,66 @@ static Bool amdgpu_kernel_mode_enabled(S
>
>  static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn,
>                                  struct pci_device *pci_dev,
> -                                struct xf86_platform_device *platform_dev)
> +                                struct xf86_platform_device *platform_dev,
> +                                AMDGPUEntPtr pAMDGPUEnt)
>  {
> +#define MAX_DRM_DEVICES 64
> +       drmDevicePtr devices[MAX_DRM_DEVICES];
>         struct pci_device *dev;
> -       char *busid;
> -       int fd;
> +       const char *path;
> +       int fd = -1, i, ret;
> +
> +       if (platform_dev)
> +               dev = platform_dev->pdev;
> +       else
> +               dev = pci_dev;
> +
> +       XNFasprintf(&pAMDGPUEnt->busid, "pci:%04x:%02x:%02x.%u",
> +                   dev->domain, dev->bus, dev->dev, dev->func);
>
> -#ifdef ODEV_ATTRIB_FD
>         if (platform_dev) {
> +#ifdef ODEV_ATTRIB_FD
>                 fd = xf86_get_platform_device_int_attrib(platform_dev,
>                                                          ODEV_ATTRIB_FD, -1);
>                 if (fd != -1)
>                         return fd;
> -       }
>  #endif
>
> -       if (platform_dev)
> -               dev = platform_dev->pdev;
> -       else
> -               dev = pci_dev;
> +#ifdef ODEV_ATTRIB_PATH
> +               path = xf86_get_platform_device_attrib(platform_dev,
> +                                                      ODEV_ATTRIB_PATH);
>
> -       busid = amdgpu_bus_id(pScrn, dev);
> -       if (!busid)
> +               fd = priv_open_device(path);
> +               if (fd != -1)
> +                       return fd;
> +#endif
> +       }
> +
> +       if (!amdgpu_kernel_mode_enabled(pScrn))
>                 return -1;
>
> -       if (!amdgpu_kernel_mode_enabled(pScrn, busid)) {
> -               free(busid);
> +       ret = drmGetDevices2(0, devices, ARRAY_SIZE(devices));
> +       if (ret == -1) {
> +               xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> +                          "[drm] Failed to retrieve DRM devices 
> information.\n");
>                 return -1;
>         }
> +       for (i = 0; i < ret; i++) {
> +               if (amdgpu_device_matches(devices[i], dev) &&
> +                   devices[i]->available_nodes & (1 << DRM_NODE_PRIMARY)) {
> +                       path = devices[i]->nodes[DRM_NODE_PRIMARY];
> +                       fd = priv_open_device(path);
> +                       break;
> +               }
> +       }
> +       drmFreeDevices(devices, ret);
>
> -       fd = drmOpen(NULL, busid);
>         if (fd == -1)
>                 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>                            "[drm] Failed to open DRM device for %s: %s\n",
> -                          busid, strerror(errno));
> -       free(busid);
> +                          pAMDGPUEnt->busid, strerror(errno));
>         return fd;
> +#undef MAX_DRM_DEVICES
>  }
>
>  void amdgpu_kernel_close_fd(AMDGPUEntPtr pAMDGPUEnt)
> @@ -156,32 +185,31 @@ void amdgpu_kernel_close_fd(AMDGPUEntPtr
>         if (!(pAMDGPUEnt->platform_dev &&
>               pAMDGPUEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
>  #endif
> -               drmClose(pAMDGPUEnt->fd);
> +               close(pAMDGPUEnt->fd);
>         pAMDGPUEnt->fd = -1;
>  }
>
> -static Bool amdgpu_open_drm_master(ScrnInfoPtr pScrn, AMDGPUEntPtr 
> pAMDGPUEnt,
> -                                  struct pci_device *pci_dev)
> +/* Pull a local version of the helper. It's available since 2.4.98 yet
> + * it may be too new for some distributions.
> + */
> +static int local_drmIsMaster(int fd)
>  {
> -       drmSetVersion sv;
> -       int err;
> +       return drmAuthMagic(fd, 0) != -EACCES;
> +}
>
> -       pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, pci_dev, NULL);
> +static Bool amdgpu_open_drm_master(ScrnInfoPtr pScrn,
> +                                  struct pci_device *pci_dev,
> +                                  struct xf86_platform_device *platform_dev,
> +                                  AMDGPUEntPtr pAMDGPUEnt)
> +{
> +       pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, pci_dev, platform_dev, 
> pAMDGPUEnt);
>         if (pAMDGPUEnt->fd == -1)
>                 return FALSE;
>
> -       /* Check that what we opened was a master or a master-capable FD,
> -        * by setting the version of the interface we'll use to talk to it.
> -        * (see DRIOpenDRMMaster() in DRI1)
> -        */
> -       sv.drm_di_major = 1;
> -       sv.drm_di_minor = 1;
> -       sv.drm_dd_major = -1;
> -       sv.drm_dd_minor = -1;
> -       err = drmSetInterfaceVersion(pAMDGPUEnt->fd, &sv);
> -       if (err != 0) {
> +       /* Check that what we opened is a master or a master-capable FD */
> +       if (!local_drmIsMaster(pAMDGPUEnt->fd)) {
>                 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -                          "[drm] failed to set drm interface version.\n");
> +                          "[drm] device is not DRM master.\n");
>                 amdgpu_kernel_close_fd(pAMDGPUEnt);
>                 return FALSE;
>         }
> @@ -189,16 +217,43 @@ static Bool amdgpu_open_drm_master(ScrnI
>         return TRUE;
>  }
>
> -static Bool amdgpu_get_scrninfo(int entity_num, struct pci_device *pci_dev)
> +static Bool amdgpu_device_setup(ScrnInfoPtr pScrn,
> +                               struct pci_device *pci_dev,
> +                               struct xf86_platform_device *platform_dev,
> +                               AMDGPUEntPtr pAMDGPUEnt)
> +{
> +       uint32_t major_version;
> +       uint32_t minor_version;
> +
> +       pAMDGPUEnt->platform_dev = platform_dev;
> +       if (!amdgpu_open_drm_master(pScrn, pci_dev, platform_dev,
> +                                   pAMDGPUEnt))
> +               return FALSE;
> +
> +       if (amdgpu_device_initialize(pAMDGPUEnt->fd,
> +                                    &major_version,
> +                                    &minor_version,
> +                                    &pAMDGPUEnt->pDev)) {
> +               xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> +                          "amdgpu_device_initialize failed\n");
> +               goto error_amdgpu;
> +       }
> +
> +       return TRUE;
> +
> +error_amdgpu:
> +       amdgpu_kernel_close_fd(pAMDGPUEnt);
> +       return FALSE;
> +}
> +
> +static Bool
> +amdgpu_probe(ScrnInfoPtr pScrn, int entity_num,
> +            struct pci_device *pci_dev, struct xf86_platform_device *dev)
>  {
> -       ScrnInfoPtr pScrn = NULL;
>         EntityInfoPtr pEnt = NULL;
>         DevUnion *pPriv;
>         AMDGPUEntPtr pAMDGPUEnt;
>
> -       pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, NULL,
> -                                   NULL, NULL, NULL, NULL, NULL);
> -
>         if (!pScrn)
>                 return FALSE;
>
> @@ -206,7 +261,6 @@ static Bool amdgpu_get_scrninfo(int enti
>         pScrn->driverName = AMDGPU_DRIVER_NAME;
>         pScrn->name = AMDGPU_NAME;
>         pScrn->Probe = NULL;
> -
>         pScrn->PreInit = AMDGPUPreInit_KMS;
>         pScrn->ScreenInit = AMDGPUScreenInit_KMS;
>         pScrn->SwitchMode = AMDGPUSwitchMode_KMS;
> @@ -229,27 +283,16 @@ static Bool amdgpu_get_scrninfo(int enti
>         pPriv = xf86GetEntityPrivate(pEnt->index, gAMDGPUEntityIndex);
>
>         if (!pPriv->ptr) {
> -               uint32_t major_version;
> -               uint32_t minor_version;
> -
>                 pPriv->ptr = xnfcalloc(sizeof(AMDGPUEntRec), 1);
>                 if (!pPriv->ptr)
>                         goto error;
>
>                 pAMDGPUEnt = pPriv->ptr;
> -               if (!amdgpu_open_drm_master(pScrn, pAMDGPUEnt, pci_dev))
> +               if (!amdgpu_device_setup(pScrn, pci_dev, dev, pAMDGPUEnt))
>                         goto error;
>
>                 pAMDGPUEnt->fd_ref = 1;
>
> -               if (amdgpu_device_initialize(pAMDGPUEnt->fd,
> -                                            &major_version,
> -                                            &minor_version,
> -                                            &pAMDGPUEnt->pDev)) {
> -                       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -                                  "amdgpu_device_initialize failed\n");
> -                       goto error_amdgpu;
> -               }
>         } else {
>                 pAMDGPUEnt = pPriv->ptr;
>
> @@ -271,8 +314,6 @@ static Bool amdgpu_get_scrninfo(int enti
>
>         return TRUE;
>
> -error_amdgpu:
> -       amdgpu_kernel_close_fd(pAMDGPUEnt);
>  error:
>         free(pEnt);
>         return FALSE;
> @@ -282,7 +323,10 @@ static Bool
>  amdgpu_pci_probe(DriverPtr pDriver,
>                  int entity_num, struct pci_device *device, intptr_t 
> match_data)
>  {
> -       return amdgpu_get_scrninfo(entity_num, device);
> +       ScrnInfoPtr pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL,
> +                                               NULL, NULL, NULL, NULL, NULL);
> +
> +       return amdgpu_probe(pScrn, entity_num, device, NULL);
>  }
>
>  static Bool AMDGPUDriverFunc(ScrnInfoPtr scrn, xorgDriverFuncOp op, void 
> *data)
> @@ -311,9 +355,6 @@ amdgpu_platform_probe(DriverPtr pDriver,
>  {
>         ScrnInfoPtr pScrn;
>         int scr_flags = 0;
> -       EntityInfoPtr pEnt = NULL;
> -       DevUnion *pPriv;
> -       AMDGPUEntPtr pAMDGPUEnt;
>
>         if (!dev->pdev)
>                 return FALSE;
> @@ -326,78 +367,7 @@ amdgpu_platform_probe(DriverPtr pDriver,
>                 xf86SetEntityShared(entity_num);
>         xf86AddEntityToScreen(pScrn, entity_num);
>
> -       pScrn->driverVersion = AMDGPU_VERSION_CURRENT;
> -       pScrn->driverName = AMDGPU_DRIVER_NAME;
> -       pScrn->name = AMDGPU_NAME;
> -       pScrn->Probe = NULL;
> -       pScrn->PreInit = AMDGPUPreInit_KMS;
> -       pScrn->ScreenInit = AMDGPUScreenInit_KMS;
> -       pScrn->SwitchMode = AMDGPUSwitchMode_KMS;
> -       pScrn->AdjustFrame = AMDGPUAdjustFrame_KMS;
> -       pScrn->EnterVT = AMDGPUEnterVT_KMS;
> -       pScrn->LeaveVT = AMDGPULeaveVT_KMS;
> -       pScrn->FreeScreen = AMDGPUFreeScreen_KMS;
> -       pScrn->ValidMode = AMDGPUValidMode;
> -
> -       pEnt = xf86GetEntityInfo(entity_num);
> -
> -       /* Create a AMDGPUEntity for all chips, even with old single head
> -        * Radeon, need to use pAMDGPUEnt for new monitor detection routines.
> -        */
> -       xf86SetEntitySharable(entity_num);
> -
> -       if (gAMDGPUEntityIndex == -1)
> -               gAMDGPUEntityIndex = xf86AllocateEntityPrivateIndex();
> -
> -       pPriv = xf86GetEntityPrivate(pEnt->index, gAMDGPUEntityIndex);
> -
> -       if (!pPriv->ptr) {
> -               uint32_t major_version;
> -               uint32_t minor_version;
> -
> -               pPriv->ptr = xnfcalloc(sizeof(AMDGPUEntRec), 1);
> -               pAMDGPUEnt = pPriv->ptr;
> -               pAMDGPUEnt->platform_dev = dev;
> -               pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, NULL, dev);
> -               if (pAMDGPUEnt->fd < 0)
> -                       goto error;
> -
> -               pAMDGPUEnt->fd_ref = 1;
> -
> -               if (amdgpu_device_initialize(pAMDGPUEnt->fd,
> -                                            &major_version,
> -                                            &minor_version,
> -                                            &pAMDGPUEnt->pDev)) {
> -                       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -                                  "amdgpu_device_initialize failed\n");
> -                       goto error_amdgpu;
> -               }
> -       } else {
> -               pAMDGPUEnt = pPriv->ptr;
> -
> -               if (pAMDGPUEnt->fd_ref == ARRAY_SIZE(pAMDGPUEnt->scrn)) {
> -                       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -                                  "Only up to %u Zaphod instances 
> supported\n",
> -                                  (unsigned)ARRAY_SIZE(pAMDGPUEnt->scrn));
> -                       goto error;
> -               }
> -
> -               pAMDGPUEnt->fd_ref++;
> -       }
> -
> -       xf86SetEntityInstanceForScreen(pScrn, pEnt->index,
> -                                      xf86GetNumEntityInstances(pEnt->
> -                                                                index)
> -                                      - 1);
> -       free(pEnt);
> -
> -       return TRUE;
> -
> -error_amdgpu:
> -       amdgpu_kernel_close_fd(pAMDGPUEnt);
> -error:
> -       free(pEnt);
> -       return FALSE;
> +       return amdgpu_probe(pScrn, entity_num, NULL, dev);
>  }
>  #endif
>
> Index: driver/xf86-video-amdgpu/src/amdgpu_probe.h
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_probe.h,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 amdgpu_probe.h
> --- driver/xf86-video-amdgpu/src/amdgpu_probe.h 16 Apr 2019 01:49:40 -0000    
>   1.1.1.1
> +++ driver/xf86-video-amdgpu/src/amdgpu_probe.h 7 Jul 2021 13:42:25 -0000
> @@ -69,6 +69,7 @@ typedef struct {
>         ScrnInfoPtr scrn[6];
>         struct xf86_platform_device *platform_dev;
>         char *render_node;
> +       char *busid;
>  } AMDGPUEntRec, *AMDGPUEntPtr;
>
>  extern void amdgpu_kernel_close_fd(AMDGPUEntPtr pAMDGPUEnt);
> Index: driver/xf86-video-amdgpu/src/compat-api.h
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/compat-api.h,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 compat-api.h
> --- driver/xf86-video-amdgpu/src/compat-api.h   16 Apr 2019 01:49:36 -0000    
>   1.1.1.1
> +++ driver/xf86-video-amdgpu/src/compat-api.h   7 Jul 2021 13:42:25 -0000
> @@ -38,4 +38,10 @@
>  #define BLOCKHANDLER_ARGS pScreen, pTimeout, pReadmask
>  #endif
>
> +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2)
> +#define current_primary current_master
> +#define primary_pixmap master_pixmap
> +#define secondary_dst slave_dst
> +#endif
> +
>  #endif
> Index: driver/xf86-video-amdgpu/src/drmmode_display.c
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/drmmode_display.c,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 drmmode_display.c
> --- driver/xf86-video-amdgpu/src/drmmode_display.c      16 Apr 2019 01:49:44 
> -0000      1.1.1.1
> +++ driver/xf86-video-amdgpu/src/drmmode_display.c      7 Jul 2021 13:42:25 
> -0000
> @@ -40,15 +40,13 @@
>  #include "mipointrst.h"
>  #include "xf86cmap.h"
>  #include "xf86Priv.h"
> -#include "sarea.h"
> +#include <xf86drm.h>
>
>  #include "drmmode_display.h"
>  #include "amdgpu_bo_helper.h"
>  #include "amdgpu_glamor.h"
>  #include "amdgpu_pixmap.h"
>
> -#include <dri.h>
> -
>  /* DPMS */
>  #ifdef HAVE_XEXTPROTO_71
>  #include <X11/extensions/dpmsconst.h>
> @@ -97,42 +95,6 @@ AMDGPUZaphodStringMatches(ScrnInfoPtr pS
>  }
>
>
> -static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
> -                                         int width, int height,
> -                                         int depth, int bpp,
> -                                         int pitch,
> -                                         struct amdgpu_buffer *bo)
> -{
> -       ScreenPtr pScreen = pScrn->pScreen;
> -       PixmapPtr pixmap;
> -
> -       pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth,
> -                                         AMDGPU_CREATE_PIXMAP_SCANOUT);
> -       if (!pixmap)
> -               return NULL;
> -
> -       if (!(*pScreen->ModifyPixmapHeader) (pixmap, width, height,
> -                                            depth, bpp, pitch, NULL))
> -               goto fail;
> -
> -       if (!amdgpu_glamor_create_textured_pixmap(pixmap, bo))
> -               goto fail;
> -
> -       if (amdgpu_set_pixmap_bo(pixmap, bo))
> -               return pixmap;
> -
> -fail:
> -       pScreen->DestroyPixmap(pixmap);
> -       return NULL;
> -}
> -
> -static void drmmode_destroy_bo_pixmap(PixmapPtr pixmap)
> -{
> -       ScreenPtr pScreen = pixmap->drawable.pScreen;
> -
> -       (*pScreen->DestroyPixmap) (pixmap);
> -}
> -
>  static void
>  drmmode_ConvertFromKMode(ScrnInfoPtr scrn,
>                          drmModeModeInfo * kmode, DisplayModePtr mode)
> @@ -505,22 +467,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn,
>  }
>
>  void
> -drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
> -                            struct drmmode_scanout *scanout)
> -{
> -
> -       if (scanout->pixmap) {
> -               drmmode_destroy_bo_pixmap(scanout->pixmap);
> -               scanout->pixmap = NULL;
> -       }
> -
> -       if (scanout->bo) {
> -               amdgpu_bo_unref(&scanout->bo);
> -               scanout->bo = NULL;
> -       }
> -}
> -
> -void
>  drmmode_crtc_scanout_free(xf86CrtcPtr crtc)
>  {
>         drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> @@ -532,60 +478,43 @@ drmmode_crtc_scanout_free(xf86CrtcPtr cr
>                 amdgpu_drm_queue_handle_deferred(crtc);
>         }
>
> -       drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode,
> -                                    &drmmode_crtc->scanout[0]);
> -       drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode,
> -                                    &drmmode_crtc->scanout[1]);
> +       drmmode_crtc_scanout_destroy(&drmmode_crtc->scanout[0]);
> +       drmmode_crtc_scanout_destroy(&drmmode_crtc->scanout[1]);
>
>         if (drmmode_crtc->scanout_damage)
>                 DamageDestroy(drmmode_crtc->scanout_damage);
>  }
>
> -PixmapPtr
> -drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct drmmode_scanout 
> *scanout,
> +static Bool
> +drmmode_crtc_scanout_create(xf86CrtcPtr crtc, PixmapPtr *scanout,
>                             int width, int height)
>  {
>         ScrnInfoPtr pScrn = crtc->scrn;
> -       drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> -       drmmode_ptr drmmode = drmmode_crtc->drmmode;
> -       int pitch;
> +       ScreenPtr screen = pScrn->pScreen;
>
> -       if (scanout->pixmap) {
> -               if (scanout->width == width && scanout->height == height)
> -                       return scanout->pixmap;
> +       if (*scanout) {
> +               if ((*scanout)->drawable.width == width &&
> +                   (*scanout)->drawable.height == height)
> +                       return TRUE;
>
> -               drmmode_crtc_scanout_destroy(drmmode, scanout);
> +               drmmode_crtc_scanout_destroy(scanout);
>         }
>
> -       scanout->bo = amdgpu_alloc_pixmap_bo(pScrn, width, height,
> -                                            pScrn->depth, 0,
> -                                            pScrn->bitsPerPixel, &pitch);
> -       if (!scanout->bo) {
> -               xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -                          "Failed to allocate scanout buffer memory\n");
> -               return NULL;
> -       }
> -
> -       scanout->pixmap = drmmode_create_bo_pixmap(pScrn,
> -                                                width, height,
> -                                                pScrn->depth,
> -                                                pScrn->bitsPerPixel,
> -                                                pitch, scanout->bo);
> -       if (!scanout->pixmap) {
> +       *scanout = screen->CreatePixmap(screen, width, height, pScrn->depth,
> +                                       AMDGPU_CREATE_PIXMAP_SCANOUT);
> +       if (!*scanout) {
>                 ErrorF("failed to create CRTC scanout pixmap\n");
>                 goto error;
>         }
>
> -       if (amdgpu_pixmap_get_fb(scanout->pixmap)) {
> -               scanout->width = width;
> -               scanout->height = height;
> -       } else {
> +       if (!amdgpu_pixmap_get_fb(*scanout)) {
>                 ErrorF("failed to create CRTC scanout FB\n");
>  error:
> -               drmmode_crtc_scanout_destroy(drmmode, scanout);
> +               drmmode_crtc_scanout_destroy(scanout);
> +               return FALSE;
>         }
>
> -       return scanout->pixmap;
> +       return TRUE;
>  }
>
>  static void
> @@ -705,8 +634,7 @@ drmmode_crtc_prime_scanout_update(xf86Cr
>         ScreenPtr screen = scrn->pScreen;
>         drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
>
> -       if (drmmode_crtc->tear_free &&
> -           !drmmode_crtc->scanout[1].pixmap) {
> +       if (drmmode_crtc->tear_free && !drmmode_crtc->scanout[1]) {
>                 RegionPtr region;
>                 BoxPtr box;
>
> @@ -729,8 +657,8 @@ drmmode_crtc_prime_scanout_update(xf86Cr
>                 xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list,
>                                          ent) {
>                         if (amdgpu_dirty_src_equals(dirty, 
> drmmode_crtc->prime_scanout_pixmap)) {
> -                               dirty->slave_dst =
> -                                       
> drmmode_crtc->scanout[scanout_id].pixmap;
> +                               dirty->secondary_dst =
> +                                       drmmode_crtc->scanout[scanout_id];
>                                 break;
>                         }
>                 }
> @@ -738,9 +666,9 @@ drmmode_crtc_prime_scanout_update(xf86Cr
>                 if (!drmmode_crtc->tear_free) {
>                         GCPtr gc = GetScratchGC(scrn->depth, screen);
>
> -                       
> ValidateGC(&drmmode_crtc->scanout[0].pixmap->drawable, gc);
> -                       
> gc->ops->CopyArea(&drmmode_crtc->scanout[1].pixmap->drawable,
> -                                         
> &drmmode_crtc->scanout[0].pixmap->drawable,
> +                       ValidateGC(&drmmode_crtc->scanout[0]->drawable, gc);
> +                       gc->ops->CopyArea(&drmmode_crtc->scanout[1]->drawable,
> +                                         &drmmode_crtc->scanout[0]->drawable,
>                                           gc, 0, 0, mode->HDisplay, 
> mode->VDisplay,
>                                           0, 0);
>                         FreeScratchGC(gc);
> @@ -748,7 +676,7 @@ drmmode_crtc_prime_scanout_update(xf86Cr
>                 }
>         }
>
> -       *fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
> +       *fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id]);
>         *x = *y = 0;
>         drmmode_crtc->scanout_id = scanout_id;
>  }
> @@ -771,9 +699,9 @@ drmmode_crtc_scanout_update(xf86CrtcPtr
>                                             mode->HDisplay, mode->VDisplay);
>         }
>
> -       if (drmmode_crtc->scanout[scanout_id].pixmap &&
> +       if (drmmode_crtc->scanout[scanout_id] &&
>             (!drmmode_crtc->tear_free ||
> -            drmmode_crtc->scanout[scanout_id ^ 1].pixmap)) {
> +            drmmode_crtc->scanout[scanout_id ^ 1])) {
>                 BoxRec extents = { .x1 = 0, .y1 = 0,
>                                    .x2 = scrn->virtualX, .y2 = scrn->virtualY 
> };
>
> @@ -787,7 +715,7 @@ drmmode_crtc_scanout_update(xf86CrtcPtr
>                                        drmmode_crtc->scanout_damage);
>                 }
>
> -               *fb = 
> amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
> +               *fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id]);
>                 *x = *y = 0;
>
>                 if (amdgpu_scanout_do_update(crtc, scanout_id,
> @@ -1370,7 +1298,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc,
>         drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
>         Bool handle_deferred = FALSE;
>         unsigned scanout_id = 0;
> -       drmmode_ptr drmmode = drmmode_crtc->drmmode;
>         int saved_x, saved_y;
>         Rotation saved_rotation;
>         DisplayModeRec saved_mode;
> @@ -1407,8 +1334,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc,
>                 if (drmmode_crtc->prime_scanout_pixmap) {
>                         drmmode_crtc_prime_scanout_update(crtc, mode, 
> scanout_id,
>                                                           &fb, &x, &y);
> -               } else if (drmmode_crtc->rotate.pixmap) {
> -                       fb = 
> amdgpu_pixmap_get_fb(drmmode_crtc->rotate.pixmap);
> +               } else if (drmmode_crtc->rotate) {
> +                       fb = amdgpu_pixmap_get_fb(drmmode_crtc->rotate);
>                         x = y = 0;
>
>                 } else if (!pScreen->isGPU &&
> @@ -1489,13 +1416,11 @@ done:
>         } else {
>                 crtc->active = TRUE;
>
> -               if (drmmode_crtc->scanout[scanout_id].pixmap &&
> -                   fb != amdgpu_pixmap_get_fb(drmmode_crtc->
> -                                              scanout[scanout_id].pixmap)) {
> +               if (drmmode_crtc->scanout[scanout_id] &&
> +                   fb != 
> amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id])) {
>                         drmmode_crtc_scanout_free(crtc);
>                 } else if (!drmmode_crtc->tear_free) {
> -                       drmmode_crtc_scanout_destroy(drmmode,
> -                                                    
> &drmmode_crtc->scanout[1]);
> +                       
> drmmode_crtc_scanout_destroy(&drmmode_crtc->scanout[1]);
>                 }
>         }
>
> @@ -1784,7 +1709,7 @@ static void drmmode_show_cursor(xf86Crtc
>                 arg.hot_y = yhot;
>
>                 ret = drmIoctl(pAMDGPUEnt->fd, DRM_IOCTL_MODE_CURSOR2, &arg);
> -               if (ret == -EINVAL)
> +               if (ret == -1 && errno == EINVAL)
>                         use_set_cursor2 = FALSE;
>                 else
>                         return;
> @@ -1819,7 +1744,7 @@ drmmode_crtc_shadow_create(xf86CrtcPtr c
>                                             height);
>         }
>
> -       return drmmode_crtc->rotate.pixmap;
> +       return drmmode_crtc->rotate;
>  }
>
>  static void
> @@ -1827,9 +1752,8 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr
>                             void *data)
>  {
>         drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> -       drmmode_ptr drmmode = drmmode_crtc->drmmode;
>
> -       drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->rotate);
> +       drmmode_crtc_scanout_destroy(&drmmode_crtc->rotate);
>  }
>
>  static void
> @@ -1865,7 +1789,7 @@ static Bool drmmode_set_scanout_pixmap(x
>
>         xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
>                 if (amdgpu_dirty_src_equals(dirty, 
> drmmode_crtc->prime_scanout_pixmap)) {
> -                       PixmapStopDirtyTracking(dirty->src, dirty->slave_dst);
> +                       PixmapStopDirtyTracking(dirty->src, 
> dirty->secondary_dst);
>                         break;
>                 }
>         }
> @@ -1893,16 +1817,16 @@ static Bool drmmode_set_scanout_pixmap(x
>
>  #ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
>         PixmapStartDirtyTracking(&ppix->drawable,
> -                                drmmode_crtc->scanout[scanout_id].pixmap,
> +                                drmmode_crtc->scanout[scanout_id],
>                                  0, 0, 0, 0, RR_Rotate_0);
>  #elif defined(HAS_DIRTYTRACKING_ROTATION)
> -       PixmapStartDirtyTracking(ppix, 
> drmmode_crtc->scanout[scanout_id].pixmap,
> +       PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[scanout_id],
>                                  0, 0, 0, 0, RR_Rotate_0);
>  #elif defined(HAS_DIRTYTRACKING2)
> -       PixmapStartDirtyTracking2(ppix, 
> drmmode_crtc->scanout[scanout_id].pixmap,
> +       PixmapStartDirtyTracking2(ppix, drmmode_crtc->scanout[scanout_id],
>                                   0, 0, 0, 0);
>  #else
> -       PixmapStartDirtyTracking(ppix, 
> drmmode_crtc->scanout[scanout_id].pixmap, 0, 0);
> +       PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[scanout_id], 0, 
> 0);
>  #endif
>         return TRUE;
>  }
> @@ -2975,8 +2899,8 @@ static Bool drmmode_xf86crtc_resize(Scrn
>         int i, pitch, old_width, old_height, old_pitch;
>         int cpp = info->pixel_bytes;
>         PixmapPtr ppix = screen->GetScreenPixmap(screen);
> +       int hint = AMDGPU_CREATE_PIXMAP_SCANOUT;
>         void *fb_shadow;
> -       int hint = 0;
>
>         if (scrn->virtualX == width && scrn->virtualY == height)
>                 return TRUE;
> @@ -2990,9 +2914,9 @@ static Bool drmmode_xf86crtc_resize(Scrn
>         }
>
>         if (info->shadow_primary)
> -               hint = AMDGPU_CREATE_PIXMAP_LINEAR | AMDGPU_CREATE_PIXMAP_GTT;
> +               hint |= AMDGPU_CREATE_PIXMAP_LINEAR | 
> AMDGPU_CREATE_PIXMAP_GTT;
>         else if (!info->use_glamor)
> -               hint = AMDGPU_CREATE_PIXMAP_LINEAR;
> +               hint |= AMDGPU_CREATE_PIXMAP_LINEAR;
>
>         xf86DrvMsg(scrn->scrnIndex, X_INFO,
>                    "Allocate new frame buffer %dx%d\n", width, height);
> @@ -3432,7 +3356,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn,
>         unsigned int crtcs_needed = 0;
>         unsigned int crtcs_got = 0;
>         drmModeResPtr mode_res;
> -       char *bus_id_string, *provider_name;
> +       char *provider_name;
>
>         xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
>
> @@ -3495,9 +3419,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn,
>         /* workout clones */
>         drmmode_clones_init(pScrn, drmmode, mode_res);
>
> -       bus_id_string = DRICreatePCIBusID(info->PciInfo);
> -       XNFasprintf(&provider_name, "%s @ %s", pScrn->chipset, bus_id_string);
> -       free(bus_id_string);
> +       XNFasprintf(&provider_name, "%s @ %s", pScrn->chipset, 
> pAMDGPUEnt->busid);
>         xf86ProviderSetup(pScrn, NULL, provider_name);
>         free(provider_name);
>
> @@ -4127,7 +4049,7 @@ Bool amdgpu_do_pageflip(ScrnInfoPtr scrn
>                         }
>
>                         drmmode_fb_reference(pAMDGPUEnt->fd, 
> &flipdata->fb[crtc_id],
> -                                            
> amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap));
> +                                            
> amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id]));
>                         if (!flipdata->fb[crtc_id]) {
>                                 ErrorF("Failed to get FB for TearFree 
> flip\n");
>                                 goto error;
> Index: driver/xf86-video-amdgpu/src/drmmode_display.h
> ===================================================================
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/drmmode_display.h,v
> retrieving revision 1.2
> diff -u -p -r1.2 drmmode_display.h
> --- driver/xf86-video-amdgpu/src/drmmode_display.h      18 Jan 2021 01:31:19 
> -0000      1.2
> +++ driver/xf86-video-amdgpu/src/drmmode_display.h      7 Jul 2021 13:42:25 
> -0000
> @@ -96,12 +96,6 @@ enum drmmode_scanout_status {
>         DRMMODE_SCANOUT_VBLANK_FAILED = 1u << 1,
>  };
>
> -struct drmmode_scanout {
> -       struct amdgpu_buffer *bo;
> -       PixmapPtr pixmap;
> -       int width, height;
> -};
> -
>  typedef struct {
>         drmmode_ptr drmmode;
>         drmModeCrtcPtr mode_crtc;
> @@ -115,8 +109,8 @@ typedef struct {
>         unsigned cursor_id;
>         struct amdgpu_buffer *cursor_buffer[2];
>
> -       struct drmmode_scanout rotate;
> -       struct drmmode_scanout scanout[2];
> +       PixmapPtr rotate;
> +       PixmapPtr scanout[2];
>         DamagePtr scanout_damage;
>         Bool ignore_damage;
>         RegionRec scanout_last_region;
> @@ -202,9 +196,9 @@ drmmode_crtc_can_flip(xf86CrtcPtr crtc)
>
>         return crtc->enabled &&
>                 drmmode_crtc->dpms_mode == DPMSModeOn &&
> -               !drmmode_crtc->rotate.bo &&
> +               !drmmode_crtc->rotate &&
>                 (drmmode_crtc->tear_free ||
> -                !drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo);
> +                !drmmode_crtc->scanout[drmmode_crtc->scanout_id]);
>  }
>
>
> @@ -240,6 +234,17 @@ drmmode_fb_reference_loc(int drm_fd, str
>         drmmode_fb_reference_loc(fd, old, new, __func__, __LINE__)
>
>
> +static inline void
> +drmmode_crtc_scanout_destroy(PixmapPtr *scanout)
> +{
> +       if (!*scanout)
> +               return;
> +
> +       (*scanout)->drawable.pScreen->DestroyPixmap(*scanout);
> +       (*scanout) = NULL;
> +}
> +
> +
>  extern int drmmode_page_flip_target_absolute(AMDGPUEntPtr pAMDGPUEnt,
>                                              drmmode_crtc_private_ptr 
> drmmode_crtc,
>                                              int fb_id, uint32_t flags,
> @@ -259,12 +264,7 @@ extern Bool drmmode_set_desired_modes(Sc
>  extern void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
>  extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn);
>
> -extern void drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
> -                                        struct drmmode_scanout *scanout);
>  void drmmode_crtc_scanout_free(xf86CrtcPtr crtc);
> -PixmapPtr drmmode_crtc_scanout_create(xf86CrtcPtr crtc,
> -                                     struct drmmode_scanout *scanout,
> -                                     int width, int height);
>
>  extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
>  extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
>

Reply via email to