xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2017-09-28 Thread Timo Aaltonen
 Makefile.am  |2 
 README   |   14 
 autogen.sh   |2 
 configure.ac |   15 
 man/amdgpu.man   |   12 
 src/Makefile.am  |1 
 src/amdgpu_bo_helper.c   |   32 +
 src/amdgpu_bo_helper.h   |2 
 src/amdgpu_dri2.c|  183 ++
 src/amdgpu_drm_queue.c   |5 
 src/amdgpu_drv.h |   50 ++
 src/amdgpu_glamor.c  |   16 
 src/amdgpu_glamor.h  |4 
 src/amdgpu_glamor_wrappers.c |4 
 src/amdgpu_kms.c |  448 --
 src/amdgpu_list.h|   40 --
 src/amdgpu_pixmap.h  |   66 +++
 src/amdgpu_present.c |  119 ---
 src/amdgpu_probe.h   |   14 
 src/amdgpu_video.c   |2 
 src/compat-api.h |   70 
 src/drmmode_display.c|  729 +++
 src/drmmode_display.h|   99 -
 23 files changed, 1051 insertions(+), 878 deletions(-)

New commits:
commit cf1767a9a58a3ec95622a7b8ca661113e2148da9
Author: Michel Dänzer 
Date:   Fri Sep 8 16:19:48 2017 +0900

Bump version for 1.4.0 release

diff --git a/configure.ac b/configure.ac
index 506c372..0896fb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.3.99],
+[1.4.0],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/AMDgpu],
 [xf86-video-amdgpu])
 

commit 114de91e3548cd30b709b19f1447f597e71175e0
Author: Michel Dänzer 
Date:   Thu Aug 31 17:59:08 2017 +0900

Require xserver >= 1.13

xserver 1.13.0 was released on September 6th, 2012, almost 5 years ago.

This allows cleaning up a bunch of backwards compatibility code.

(Ported from radeon commit 5cdd334b3402c2431deb3a87a8d04ef590da53ee)
Reviewed-by: Alex Deucher 

diff --git a/configure.ac b/configure.ac
index 6d7cee4..506c372 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@ PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.72])
 PKG_CHECK_MODULES(GBM, [gbm])
 
 # Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10 xproto fontsproto xf86driproto 
$REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.13 xproto fontsproto xf86driproto 
$REQUIRED_MODULES])
 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
   HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, 
[xextproto 7.1 available]),
   HAVE_XEXTPROTO_71="no")
@@ -180,12 +180,6 @@ AC_CHECK_DECL(xf86CursorResetCursor,
  [#include 
   #include ])
 
-AC_CHECK_DECL(xorg_list_init,
- [AC_DEFINE(HAVE_XORG_LIST, 1, [Have xorg_list API])], [],
- [#include 
- #include "xorg-server.h"
- #include "list.h"])
-
 AC_CHECK_DECL(GBM_BO_USE_LINEAR,
  [AC_DEFINE(HAVE_GBM_BO_USE_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], 
[],
  [#include 
diff --git a/src/Makefile.am b/src/Makefile.am
index 7468bba..c23c87d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -62,7 +62,6 @@ EXTRA_DIST = \
amdgpu_drm_queue.h \
amdgpu_glamor.h \
amdgpu_drv.h \
-   amdgpu_list.h \
amdgpu_pixmap.h \
amdgpu_probe.h \
amdgpu_version.h \
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index ee52e0c..ba22122 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -79,13 +79,8 @@ struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr 
pScrn, int width,
bo_use |= GBM_BO_USE_SCANOUT;
 
 #ifdef HAVE_GBM_BO_USE_LINEAR
-#ifdef CREATE_PIXMAP_USAGE_SHARED
-   if (usage_hint == CREATE_PIXMAP_USAGE_SHARED) {
-   bo_use |= GBM_BO_USE_LINEAR;
-   }
-#endif
-
-   if (usage_hint & AMDGPU_CREATE_PIXMAP_LINEAR) {
+   if (usage_hint == CREATE_PIXMAP_USAGE_SHARED ||
+   (usage_hint & AMDGPU_CREATE_PIXMAP_LINEAR)) {
bo_use |= GBM_BO_USE_LINEAR;
}
 #endif
@@ -394,7 +389,6 @@ struct amdgpu_buffer 
*amdgpu_gem_bo_open_prime(amdgpu_device_handle pDev,
return bo;
 }
 
-#ifdef AMDGPU_PIXMAP_SHARING
 
 Bool amdgpu_set_shared_pixmap_backing(PixmapPtr ppix, void *fd_handle)
 {
@@ -467,5 +461,3 @@ Bool amdgpu_set_shared_pixmap_backing(PixmapPtr ppix, void 
*fd_handle)
 
return ret;
 }
-
-#endif /* AMDGPU_PIXMAP_SHARING */
diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
index ccf5477..a8ccd22 100644
--- a/src/amdgpu_dri2.c
+++ b/src/amdgpu_dri2.c
@@ -48,15 +48,10 @@
 #include "amdgpu_bo_helper.h"
 #include "amdgpu_version.h"
 
-#include "amdgpu_list.h"
-
+#include 
 #include 
 #include 
 
-#if DRI2INFOREC_VERSION >= 9
-#define USE_DRI2_PRIME
-#endif
-
 

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2017-03-16 Thread Timo Aaltonen
 autogen.sh|   11 
 configure.ac  |   21 +
 man/amdgpu.man|   15 -
 src/Makefile.am   |8 
 src/amdgpu_chipinfo_gen.h |  194 --
 src/amdgpu_chipset_gen.h  |  216 
 src/amdgpu_dri2.c |   54 ++--
 src/amdgpu_dri3.c |   37 ++
 src/amdgpu_drv.h  |   35 ++
 src/amdgpu_glamor.c   |7 
 src/amdgpu_kms.c  |  363 ++-
 src/amdgpu_pci_chipset_gen.h  |  195 --
 src/amdgpu_pci_device_match_gen.h |  195 --
 src/amdgpu_present.c  |   18 +
 src/amdgpu_probe.c|   40 +--
 src/amdgpu_probe.h|   33 --
 src/amdpciids.h   |   39 --
 src/ati_pciids_gen.h  |  191 --
 src/drmmode_display.c |  500 ++
 src/drmmode_display.h |   19 +
 src/pcidb/ati_pciids.csv  |  192 --
 src/pcidb/parse_pci_ids.pl|   82 --
 22 files changed, 736 insertions(+), 1729 deletions(-)

New commits:
commit 804e30e14e51f94403a0721ef2aae28f1fa9e9f2
Author: Michel Dänzer 
Date:   Thu Mar 16 17:28:11 2017 +0900

Bump version for 1.3.0 release

diff --git a/configure.ac b/configure.ac
index 591c2b9..8d86f52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.2.99],
+[1.3.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit 3a8582944ed3fef1b75f8871489e6e19963e2ea6
Author: Michel Dänzer 
Date:   Thu Mar 9 15:56:59 2017 +0900

Pass TRUE to drmmode_set_desired_modes the first time for GPU screens

This is the only place we call drmmode_set_desired_modes for GPU screens
during server startup. Without this change, the display outputs of
secondary GPUs may stay on even while Xorg isn't using them.

(Ported from radeon commit 9a71445094b728f3d78db8f6808b4782ee19a453)
Reviewed-by: Alex Deucher 

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 3deaef7..4821e93 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -243,7 +243,8 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr 
pScreen)
}
}
 
-   if (!drmmode_set_desired_modes(pScrn, >drmmode, FALSE))
+   if (!drmmode_set_desired_modes(pScrn, >drmmode,
+  amdgpu_is_gpu_screen(pScreen)))
return FALSE;
 
drmmode_uevent_init(pScrn, >drmmode);

commit 82b15a4da156e18da4c8fc0093500c32b549e487
Author: Michel Dänzer 
Date:   Thu Mar 9 15:47:24 2017 +0900

Skip some initialization steps for GPU screens

Xorg doesn't use the following functionality of GPU screens, so don't
bother initializing it:

* DRI page flipping
* DRI3 / Present / SYNC fences
* XVideo / XvMC
* Root window with background None

(Ported from radeon commit 67ae5e00a748ad52cf92738d401afff2947b1891)
Reviewed-by: Alex Deucher 

diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 0700dae..532d99d 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -169,8 +169,10 @@ typedef enum {
 #if XF86_CRTC_VERSION >= 5
 #define AMDGPU_PIXMAP_SHARING 1
 #define amdgpu_is_gpu_screen(screen) (screen)->isGPU
+#define amdgpu_is_gpu_scrn(scrn) (scrn)->is_gpu
 #else
 #define amdgpu_is_gpu_screen(screen) 0
+#define amdgpu_is_gpu_scrn(scrn) 0
 #endif
 
 #define AMDGPU_VSYNC_TIMEOUT   2   /* Maximum wait for VSYNC (in usecs) */
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 92bf5fa..3deaef7 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1397,23 +1397,26 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowPrimary 
enabled\n");
}
 
-   sw_cursor = xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, 
FALSE);
-
-   info->allowPageFlip = xf86ReturnOptValBool(info->Options,
-  OPTION_PAGE_FLIP,
-  TRUE);
-   if (sw_cursor || info->shadow_primary) {
-   xf86DrvMsg(pScrn->scrnIndex,
-  info->allowPageFlip ? X_WARNING : X_DEFAULT,
-  "KMS Pageflipping: disabled%s\n",
-  info->allowPageFlip ?
-  (sw_cursor ? " because of SWcursor" :
-   " because of ShadowPrimary") : "");
-   info->allowPageFlip = FALSE;
-   } else {
-   xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-  "KMS Pageflipping: %sabled\n",
-  

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2016-11-17 Thread Timo Aaltonen
Rebased ref, commits from common ancestor:
commit a00032050873fc99f3ceaa3293468dad1d94d4b1
Author: Michel Dänzer 
Date:   Thu Nov 17 15:17:10 2016 +0900

Bump version for 1.2.0 release

diff --git a/configure.ac b/configure.ac
index abdeb40..37eac53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.1.99],
+[1.2.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit a446b3af9b055056e9fb0f37069b08b979eba277
Author: Michel Dänzer 
Date:   Thu Nov 17 15:13:59 2016 +0900

manpage updates for the 1.2.0 release

Option "TearFree" is now effective for arbitrary transforms as well.

Point to the amd-gfx mailing list instead of xorg-driver-ati.

diff --git a/man/amdgpu.man b/man/amdgpu.man
index 948cd70..0e5c291 100644
--- a/man/amdgpu.man
+++ b/man/amdgpu.man
@@ -73,10 +73,8 @@ Enable DRI2 page flipping.  The default is
 .B on.
 .TP
 .BI "Option \*qTearFree\*q \*q" boolean \*q
-Enable tearing prevention using the hardware page flipping mechanism. This
-option currently doesn't have any effect for CRTCs using transforms other than
-rotation or reflection. It requires allocating two separate scanout buffers for
-each supported CRTC. Enabling this option currently disables Option
+Enable tearing prevention using the hardware page flipping mechanism. Requires 
allocating two
+separate scanout buffers for each CRTC. Enabling this option currently 
disables Option
 \*qEnablePageFlip\*q. The default is
 .B off.
 .TP
@@ -120,7 +118,7 @@ http://cgit.freedesktop.org/xorg/driver/xf86-video-amdgpu/
 .IP " 3." 4
 Mailing list:
 .RS 4
-http://lists.x.org/mailman/listinfo/xorg-driver-ati
+http://lists.freedesktop.org/mailman/listinfo/amd-gfx
 .RE
 .IP " 4." 4
 IRC channel:

commit 24e36c7044a24294d5709c0306efacc8de6df072
Author: Michel Dänzer 
Date:   Thu Nov 10 12:30:10 2016 +0900

Use pAMDGPUEnt to find both screens of a GPU in amdgpu_mode_hotplug

Fixes misbehaviour when hotplugging DisplayPort connectors on secondary
GPUs.

Fixes: 14606e127f4b ("Handle Zaphod mode correctly in amdgpu_mode_hotplug")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98626
(Ported from radeon commit 9760ef33cba5795eddeda4d5c2fcbe2dcce21689)
Reviewed-by: Alex Deucher 

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index b21cd37..bf9058e 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1313,6 +1313,11 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
}
}
 
+   if (info->IsSecondary)
+   pAMDGPUEnt->secondary_scrn = pScrn;
+   else
+   pAMDGPUEnt->primary_scrn = pScrn;
+
info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index);
pScrn->monitor = pScrn->confScreen->monitor;
 
diff --git a/src/amdgpu_probe.h b/src/amdgpu_probe.h
index e6af3a2..802df12 100644
--- a/src/amdgpu_probe.h
+++ b/src/amdgpu_probe.h
@@ -93,6 +93,8 @@ typedef struct {
unsigned long fd_wakeup_registered; /* server generation for which 
fd has been registered for wakeup handling */
int fd_wakeup_ref;
unsigned int assigned_crtcs;
+   ScrnInfoPtr primary_scrn;
+   ScrnInfoPtr secondary_scrn;
struct xf86_platform_device *platform_dev;
 } AMDGPUEntRec, *AMDGPUEntPtr;
 
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 0ca78e0..a75cc5c 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2402,7 +2402,7 @@ amdgpu_mode_hotplug(ScrnInfoPtr scrn, drmmode_ptr drmmode)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
drmModeResPtr mode_res;
-   int i, j, s;
+   int i, j;
Bool found;
Bool changed = FALSE;
int num_dvi = 0, num_hdmi = 0;
@@ -2439,20 +2439,13 @@ restart_destroy:
 
/* find new output ids we don't have outputs for */
for (i = 0; i < mode_res->count_connectors; i++) {
-   found = FALSE;
-
-   for (s = 0; !found && s < xf86NumScreens; s++) {
-   ScrnInfoPtr loop_scrn = xf86Screens[s];
-
-   if (strcmp(loop_scrn->driverName, scrn->driverName) ||
-   AMDGPUEntPriv(loop_scrn) != pAMDGPUEnt)
-   continue;
-
-   found = drmmode_find_output(loop_scrn,
-   mode_res->connectors[i],
-   _dvi, _hdmi);
-   }
-   if (found)
+   if (drmmode_find_output(pAMDGPUEnt->primary_scrn,
+   mode_res->connectors[i],
+   _dvi, _hdmi) ||
+   

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2016-09-16 Thread Timo Aaltonen
 configure.ac |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit b407c1244d28a80f76275abca2239cdd4120f017
Author: Michel Dänzer 
Date:   Fri Sep 16 18:11:31 2016 +0900

Bump version for 1.1.2 release

diff --git a/configure.ac b/configure.ac
index ff6a368..123947b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.1.1],
+[1.1.2],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit 82062157263d6f63ce8f645bf32101fd18bd98e5
Author: Michel Dänzer 
Date:   Fri Sep 16 18:01:41 2016 +0900

Fix handling of configure option --with-xorg-conf-dir

There were two problems:

I accidentally changed the variable name in the AC_ARG_WITH stanza from
configdir to xorgconfigdir, so specifying --with-xorg-conf-dir wouldn't
work correctly. Fix this back to configdir.

If neither --with-xorg-conf-dir nor --prefix is specified on the command
line, the $prefix variable doesn't contain "/usr/local" (the default
prefix) yet at this point but "NONE". So make install would attempt to
install 10-amdgpu.conf in ${DESTDIR}NONE/share/X11/xorg.conf.d/ . Fix
this by leaving ${prefix} verbatim in the default value, to be resolved
by make.

Also print the configdir value along with the values of other similar
configuration variables.

Reported-by: Timo Aaltonen 
Reviewed-by: Julien Cristau 
(Cherry picked from commit aa8a3fa2468094cd37959179e8417ba7ba0a326c)

diff --git a/configure.ac b/configure.ac
index ed45aaa..ff6a368 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,9 +89,9 @@ PKG_CHECK_EXISTS([xorg-server >= 1.16],
 [sysconfigdir=""])
 AC_ARG_WITH(xorg-conf-dir,
 AS_HELP_STRING([--with-xorg-conf-dir=DIR],
-   [Default xorg.conf.d directory 
[[default=$prefix/share/X11/xorg.conf.d/]]]),
-[xorgconfdir="$withval"],
-[xorgconfdir="$prefix/share/X11/xorg.conf.d"])
+   [Default xorg.conf.d directory 
[[default=${prefix}/share/X11/xorg.conf.d]]]),
+[configdir="$withval"],
+[configdir='${prefix}/share/X11/xorg.conf.d'])
 AC_SUBST(configdir)
 AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$sysconfigdir" != "x"])
 
@@ -279,6 +279,7 @@ echo "prefix:  $prefix"
 echo "exec_prefix: $exec_prefix"
 echo "libdir:  $libdir"
 echo "includedir:  $includedir"
+echo "configdir:   $configdir"
 
 echo ""
 echo "CFLAGS:  $CFLAGS"



xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2016-09-15 Thread Timo Aaltonen
 configure.ac  |8 +-
 man/amdgpu.man|2 
 src/amdgpu_bo_helper.c|   48 +++-
 src/amdgpu_bo_helper.h|   20 ++-
 src/amdgpu_chipinfo_gen.h |  108 +-
 src/amdgpu_chipset_gen.h  |  108 +-
 src/amdgpu_dri2.c |   73 +++--
 src/amdgpu_glamor.c   |   80 +++-
 src/amdgpu_glamor.h   |1 
 src/amdgpu_glamor_wrappers.c  |   18 --
 src/amdgpu_kms.c  |   42 +-
 src/amdgpu_pci_chipset_gen.h  |  108 +-
 src/amdgpu_pci_device_match_gen.h |  108 +-
 src/amdgpu_pixmap.h   |2 
 src/amdgpu_probe.h|6 ++
 src/ati_pciids_gen.h  |  108 +-
 src/drmmode_display.c |   57 
 src/pcidb/ati_pciids.csv  |  108 +-
 18 files changed, 861 insertions(+), 144 deletions(-)

New commits:
commit 6eb2b507d9ec8dcde2482a5ebf59c001933e10ea
Author: Michel Dänzer 
Date:   Wed Sep 14 18:26:50 2016 +0900

Bump version for the 1.1.1 release

diff --git a/configure.ac b/configure.ac
index 9d646f1..ed45aaa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.1.0],
+[1.1.1],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit 8761c46babe0ec01da784dd27db3dd9e769acbca
Author: Michel Dänzer 
Date:   Thu Sep 15 15:28:12 2016 +0900

Use --with-xorg-conf-dir=$prefix/share/X11/xorg.conf.d by default

We were using the result of `pkg-config --variable=sysconfigdir
xorg-server` before, which may not be inside $prefix, so make install
might fail for 10-amdgpu.conf .

Fixes make distcheck in that case, and possibly also 10-amdgpu.conf
seemingly missing from some distribution packages.

This matches what some (though not all) input drivers are doing for their
xorg.conf.d snippets.

(Cherry picked from commit cd3acb75718dfd42dd25d58b4e7bd4db27b659d8)

diff --git a/configure.ac b/configure.ac
index 824467d..9d646f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,9 +89,9 @@ PKG_CHECK_EXISTS([xorg-server >= 1.16],
 [sysconfigdir=""])
 AC_ARG_WITH(xorg-conf-dir,
 AS_HELP_STRING([--with-xorg-conf-dir=DIR],
-   [Default xorg.conf.d directory [[default=from 
$PKG_CONFIG xorg-server]]]),
-[configdir="$withval"],
-[configdir="$sysconfigdir"])
+   [Default xorg.conf.d directory 
[[default=$prefix/share/X11/xorg.conf.d/]]]),
+[xorgconfdir="$withval"],
+[xorgconfdir="$prefix/share/X11/xorg.conf.d"])
 AC_SUBST(configdir)
 AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$sysconfigdir" != "x"])
 

commit ca1cf24d4eb773f7380c0da3fa942a5c85074422
Author: Marek Olšák 
Date:   Wed Sep 14 17:30:19 2016 +0900

Fix cursor size for SI

Reviewed-by: Michel Dänzer 
Acked-by: Edward O'Callaghan 
(Cherry picked from commit c4364520691d18961f0a6b77071baeeffaa80a11)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 9c1d16a..23e275d 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -939,8 +939,14 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
else
pAMDGPUEnt->HasCRTC2 = TRUE;
 
-   info->cursor_w = CURSOR_WIDTH_CIK;
-   info->cursor_h = CURSOR_HEIGHT_CIK;
+   if (info->ChipFamily >= CHIP_FAMILY_TAHITI &&
+   info->ChipFamily <= CHIP_FAMILY_HAINAN) {
+   info->cursor_w = CURSOR_WIDTH;
+   info->cursor_h = CURSOR_HEIGHT;
+   } else {
+   info->cursor_w = CURSOR_WIDTH_CIK;
+   info->cursor_h = CURSOR_HEIGHT_CIK;
+   }
 
amdgpu_query_heap_size(pAMDGPUEnt->pDev, AMDGPU_GEM_DOMAIN_GTT,
_size, _allocation);

commit ca84c49c88235e1909d11e192eada816b782f041
Author: Ronie Salgado 
Date:   Wed Sep 14 17:30:30 2016 +0900

Add SI PCI IDs

Reviewed-by: Michel Dänzer 
(Cherry picked from commit 2eb5d77b841e55e7328df4b95c0d41fec30ce10f)

diff --git a/man/amdgpu.man b/man/amdgpu.man
index 0100400..4d96866 100644
--- a/man/amdgpu.man
+++ b/man/amdgpu.man
@@ -29,7 +29,7 @@ RandR support up to version 1.4;
 .SH SUPPORTED HARDWARE
 The
 .B amdgpu
-driver supports CI and newer families' video cards.
+driver supports SI and newer families' video cards.
 .PD
 .SH CONFIGURATION DETAILS
 Please refer to 

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2016-04-07 Thread Timo Aaltonen
Rebased ref, commits from common ancestor:
commit a04f4015d6afef20c2b79e2779f6555836ee2b07
Author: Michel Dänzer 
Date:   Thu Apr 7 16:47:25 2016 +0900

Bump version for 1.1.0 release

diff --git a/configure.ac b/configure.ac
index b11475a..824467d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.0.99],
+[1.1.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit aed1c17c43b2c0c983f6fc0973a5224d0faf32d9
Author: Michel Dänzer 
Date:   Mon Apr 4 18:28:02 2016 +0900

glamor: Force GPU rendering to/from pixmaps created via DRI3

Fixes crash when running DRI3 clients with ShadowPrimary enabled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94799

Reviewed-by: Alex Deucher 

diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c
index c3042e7..0686599 100644
--- a/src/amdgpu_dri3.c
+++ b/src/amdgpu_dri3.c
@@ -135,8 +135,12 @@ static PixmapPtr amdgpu_dri3_pixmap_from_fd(ScreenPtr 
screen,
if (AMDGPUPTR(xf86ScreenToScrn(screen))->use_glamor) {
pixmap = glamor_pixmap_from_fd(screen, fd, width, height,
   stride, depth, bpp);
-   if (pixmap)
+   if (pixmap) {
+   struct amdgpu_pixmap *priv = calloc(1, sizeof(*priv));
+
+   amdgpu_set_pixmap_private(pixmap, priv);
return pixmap;
+   }
}
 #endif
 
diff --git a/src/amdgpu_glamor_wrappers.c b/src/amdgpu_glamor_wrappers.c
index 6700851..35b6d7e 100644
--- a/src/amdgpu_glamor_wrappers.c
+++ b/src/amdgpu_glamor_wrappers.c
@@ -148,10 +148,11 @@ amdgpu_glamor_finish_access_cpu(PixmapPtr pixmap)
  */
 
 static Bool
-amdgpu_glamor_use_gpu(PixmapPtr pixmap)
+amdgpu_glamor_use_gpu(PixmapPtr pixmap, struct amdgpu_pixmap *priv)
 {
return (pixmap->usage_hint &
-   (AMDGPU_CREATE_PIXMAP_SCANOUT | AMDGPU_CREATE_PIXMAP_DRI2)) != 
0;
+   (AMDGPU_CREATE_PIXMAP_SCANOUT | AMDGPU_CREATE_PIXMAP_DRI2)) != 
0 ||
+   (priv && !priv->bo);
 }
 
 static Bool
@@ -432,7 +433,7 @@ amdgpu_glamor_poly_fill_rect(DrawablePtr pDrawable, GCPtr 
pGC,
PixmapPtr pixmap = get_drawable_pixmap(pDrawable);
struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
 
-   if ((info->force_accel || amdgpu_glamor_use_gpu(pixmap)) &&
+   if ((info->force_accel || amdgpu_glamor_use_gpu(pixmap, priv)) &&
amdgpu_glamor_prepare_access_gpu(priv)) {
info->glamor.SavedPolyFillRect(pDrawable, pGC, nrect, prect);
amdgpu_glamor_finish_access_gpu_rw(info, priv);
@@ -536,8 +537,8 @@ amdgpu_glamor_copy_area(DrawablePtr pSrcDrawable, 
DrawablePtr pDstDrawable,
struct amdgpu_pixmap *dst_priv = amdgpu_get_pixmap_private(dst_pixmap);
RegionPtr ret = NULL;
 
-   if (amdgpu_glamor_use_gpu(dst_pixmap) ||
-   amdgpu_glamor_use_gpu(src_pixmap)) {
+   if (amdgpu_glamor_use_gpu(dst_pixmap, dst_priv) ||
+   amdgpu_glamor_use_gpu(src_pixmap, src_priv)) {
if (!amdgpu_glamor_prepare_access_gpu(dst_priv))
goto fallback;
if (src_priv != dst_priv &&

commit faf9d720b7d650f5f1ea657a874d08eac3972e60
Author: Michel Dänzer 
Date:   Fri Apr 1 16:09:51 2016 +0900

Update manpage entry for Option "TearFree"

It's now effective for rotation as well.

Reviewed-by: Alex Deucher 

diff --git a/man/amdgpu.man b/man/amdgpu.man
index 4e95ead..0100400 100644
--- a/man/amdgpu.man
+++ b/man/amdgpu.man
@@ -72,9 +72,10 @@ Enable DRI2 page flipping.  The default is
 .TP
 .BI "Option \*qTearFree\*q \*q" boolean \*q
 Enable tearing prevention using the hardware page flipping mechanism. This
-option currently doesn't have any effect for rotated CRTCs. It requires
-allocating two separate scanout buffers for each non-rotated CRTC. Enabling
-this option currently disables Option \*qEnablePageFlip\*q. The default is
+option currently doesn't have any effect for CRTCs using transforms other than
+rotation or reflection. It requires allocating two separate scanout buffers for
+each supported CRTC. Enabling this option currently disables Option
+\*qEnablePageFlip\*q. The default is
 .B off.
 .TP
 .BI "Option \*qAccelMethod\*q \*q" string \*q

commit 5ba95c3abeb8df82aa8d33a47596eae6403ea7af
Author: Michel Dänzer 
Date:   Fri Apr 1 15:29:26 2016 +0900

Identify DRM event queue entries by sequence number instead of by pointer

If the memory for an entry was allocated at the same address as that for
a previously cancelled entry, the handler could theoretically be called
prematurely, triggered by the DRM event 

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2016-02-21 Thread Timo Aaltonen
 configure.ac  |2 +-
 src/amdgpu_kms.c  |   33 -
 src/amdgpu_sync.c |7 +++
 src/drmmode_display.c |8 ++--
 4 files changed, 30 insertions(+), 20 deletions(-)

New commits:
commit d68b3073a9627a81b047e9bdd4b5569359df898d
Author: Michel Dänzer 
Date:   Fri Feb 19 11:53:02 2016 +0900

Bump version for 1.0.1 release

diff --git a/configure.ac b/configure.ac
index 1849a78..bbd06d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[1.0.0],
+[1.0.1],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit c25a48b68695af71dddbdb6d239b2d0ec386db9c
Author: Michel Dänzer 
Date:   Mon Feb 15 18:41:51 2016 +0900

HAS_DIRTYTRACKING_ROTATION also supports multiple CRTCs

(ported from radeon commit ff9a6b6f079a8419f4e6fadfee778060618bf735)

Reviewed-by: Alex Deucher 
(cherry picked from commit a36bbfd98b96426bbe0be3923c64da7ec0e565d0)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 40a134c..896b9d2 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -905,7 +905,7 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, 
PixmapPtr ppix)
if (max_height < iter->mode.VDisplay)
max_height = iter->mode.VDisplay;
}
-#ifndef HAS_DIRTYTRACKING2
+#if !defined(HAS_DIRTYTRACKING_ROTATION) && !defined(HAS_DIRTYTRACKING2)
if (iter != crtc) {
ErrorF
("Cannot do multiple crtcs without X server dirty 
tracking 2 interface\n");

commit a05ea868f940b9649ead2333108d69619b9003bf
Author: Michel Dänzer 
Date:   Mon Feb 15 18:35:54 2016 +0900

Load fb module before glamoregl/shadow modules

Fixes unresolved symbols on some systems.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93105
(ported from radeon commit 78fbca095ae9887a2d3de48bb07975e2d1126e68)

Reviewed-by: Alex Deucher 
(cherry picked from commit a37746ffceaed83e48e48fb05439be7e020dd2ea)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index c257941..dcecf86 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -783,6 +783,10 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
goto fail;
}
 
+   /* Get ScreenInit function */
+   if (!xf86LoadSubModule(pScrn, "fb"))
+   return FALSE;
+
if (!AMDGPUPreInitAccel_KMS(pScrn))
goto fail;
 
@@ -868,10 +872,6 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
 
-   /* Get ScreenInit function */
-   if (!xf86LoadSubModule(pScrn, "fb"))
-   return FALSE;
-
if (!xf86SetGamma(pScrn, zeros))
return FALSE;
 

commit 7729b29b0a76c3e2eacfcb02abcbe115948b2937
Author: Michel Dänzer 
Date:   Mon Feb 15 18:28:13 2016 +0900

Don't advertise any PRIME offloading capabilities without acceleration

Acceleration is required even for display offloading. Trying to enable
display offloading without acceleration resulted in a crash.

(ported from radeon commit b19417e2fddf4df725951aea5ad5e9558338f59e)
Reviewed-by: Alex Deucher 

(cherry picked from commit 59c0a6807110eca829c6708e16585a38f39a5c17)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 75d35c1..c257941 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -663,25 +663,23 @@ static Bool amdgpu_get_tile_config(ScrnInfoPtr pScrn)
 static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn)
 {
 #ifdef AMDGPU_PIXMAP_SHARING
+   AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
uint64_t value;
int ret;
 
pScrn->capabilities = 0;
+
+   /* PRIME offloading requires acceleration */
+   if (!info->use_glamor)
+   return;
+
ret = drmGetCap(pAMDGPUEnt->fd, DRM_CAP_PRIME, );
if (ret == 0) {
-   AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
-
-   if (value & DRM_PRIME_CAP_EXPORT) {
-   pScrn->capabilities |= RR_Capability_SourceOutput;
-   if (info->use_glamor && info->dri2.available)
-   pScrn->capabilities |= 
RR_Capability_SinkOffload;
-   }
-   if (value & DRM_PRIME_CAP_IMPORT) {
-   pScrn->capabilities |= RR_Capability_SinkOutput;
-   if (info->use_glamor && info->dri2.available)
-   pScrn->capabilities |= 
RR_Capability_SourceOffload;
-   }
+   

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2015-11-19 Thread Andreas Boll
 configure.ac  |5 
 man/amdgpu.man|   14 
 src/Makefile.am   |3 
 src/amdgpu_bo_helper.c|5 
 src/amdgpu_chipinfo_gen.h |1 
 src/amdgpu_chipset_gen.h  |1 
 src/amdgpu_dri2.c |  292 ---
 src/amdgpu_dri2.h |1 
 src/amdgpu_dri3.c |9 
 src/amdgpu_drv.h  |4 
 src/amdgpu_glamor.c   |4 
 src/amdgpu_kms.c  |  157 ++
 src/amdgpu_pci_chipset_gen.h  |1 
 src/amdgpu_pci_device_match_gen.h |1 
 src/amdgpu_present.c  |   98 --
 src/amdgpu_probe.c|   66 ++--
 src/amdgpu_probe.h|   10 
 src/amdgpu_video.c|   62 +---
 src/amdgpu_video.h|1 
 src/ati_pciids_gen.h  |1 
 src/drmmode_display.c |  574 +++---
 src/drmmode_display.h |   17 -
 src/pcidb/ati_pciids.csv  |1 
 23 files changed, 885 insertions(+), 443 deletions(-)

New commits:
commit 755e6ff2337cf615e3ba0854ccd533baec7144db
Author: Michel Dänzer 
Date:   Thu Nov 19 17:28:19 2015 +0900

Bump version for 1.0.0 release

diff --git a/configure.ac b/configure.ac
index 9765d0b..1849a78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-[0.0.01],
+[1.0.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-amdgpu])
 

commit 49c7d2be99aaf6d040e553065bdc461ce8d4769a
Author: Michel Dänzer 
Date:   Thu Nov 19 17:14:54 2015 +0900

Add amdgpu_pixmap.h to src/Makefile.am's EXTRA_DIST

Fixes make distcheck.

diff --git a/src/Makefile.am b/src/Makefile.am
index 4efef9e..a851b3b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -63,6 +63,7 @@ EXTRA_DIST = \
amdgpu_glamor.h \
amdgpu_drv.h \
amdgpu_list.h \
+   amdgpu_pixmap.h \
amdgpu_probe.h \
amdgpu_version.h \
amdgpu_video.h \

commit d069ec5d27f5c8d2ab17b759b85293ef4113acf3
Author: Stephen Chandler Paul 
Date:   Wed Nov 11 18:10:55 2015 +0900

Handle failures in setting a CRTC to a DRM mode properly

This fixes a bug where running the card out of PPLL's when hotplugging
another monitor would result in all of the displays going blank and
failing to work properly until X was restarted or the user switched to
another VT.

[Michel Dänzer: Pass errno instead of -ret to strerror()]

Signed-off-by: Stephen Chandler Paul 
(ported from radeon commit 7186a8713ba004de4991f21c1a9fc4abc62aeff4)

Reviewed-by: Alex Deucher 

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 66528f0..2761513 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -699,14 +699,15 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
mode,
amdgpu_glamor_finish(pScrn);
}
}
-   ret =
-   drmModeSetCrtc(pAMDGPUEnt->fd,
-  drmmode_crtc->mode_crtc->crtc_id, fb_id, x,
-  y, output_ids, output_count, );
-   if (ret)
+   if (drmModeSetCrtc(pAMDGPUEnt->fd,
+  drmmode_crtc->mode_crtc->crtc_id,
+  fb_id, x, y, output_ids,
+  output_count, ) != 0) {
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
-  "failed to set mode: %s", strerror(-ret));
-   else
+  "failed to set mode: %s\n", strerror(errno));
+   ret = FALSE;
+   goto done;
+   } else
ret = TRUE;
 
if (crtc->scrn->pScreen)

commit c8bddcf6c97b1338be3715f1fc5e0b17ce71c195
Author: Michel Dänzer 
Date:   Wed Nov 11 18:09:59 2015 +0900

Call xf86CrtcRotate from initial drmmode_set_desired_modes call

Fixes various problems when rotation is specified in xorg.conf.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92475

(ported from radeon commit 548e97b3b7d1e94075a54ca2bb4eb683025098a7)

Reviewed-by: Alex Deucher 

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 4d5a3a3..66528f0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2071,6 +2071,8 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, 
drmmode_ptr drmmode,
crtc->rotation = crtc->desiredRotation;
crtc->x = crtc->desiredX;
  

xserver-xorg-video-amdgpu: Changes to 'upstream-unstable'

2015-08-16 Thread Timo Aaltonen
New branch 'upstream-unstable' available with the following commits: