Commit Graph

3409 Commits

Author SHA1 Message Date
Michel Dänzer
55a33205cb Add 10-radeon.conf xorg.conf.d snippet
This instructs Xorg >= 1.16 to try loading the radeon driver for devices
managed by the radeon kernel driver, even if the ati wrapper driver
isn't available.

Copied from the amdgpu driver.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-26 18:27:30 +09:00
Mihail Konev
8e6a4e96b7 autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:00:22 +10:00
Emil Velikov
e062933b54 autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 11:48:03 +10:00
Peter Hutterer
4fe183111f autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-26 11:48:03 +10:00
Michel Dänzer
a1787e4615 ati: Support loading the amdgpu driver from the ati wrapper
If .../share/X11/xorg.conf.d/10-amdgpu.conf doesn't exist, but the ati
wrapper is loaded, it will otherwise try to use the radeon driver even
for GPUs driven by the amdgpu kernel driver. This can only fail,
potentially in bad ways.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-24 18:15:12 +09:00
Michel Dänzer
41b82c776b .editorconfig: src/ati.c only uses spaces for indentation
Trivial.
2017-01-24 18:14:23 +09:00
Michel Dänzer
ea30d856ba Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap
radeon_bo_get_tiling can fail, e.g. for linear BOs.

Fixes TearFree not working in those cases.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97873
Fixes: 040a7b80e1 ("Explicitly set the fbcon pixmap pitch again")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-06 17:36:05 +09:00
Jammy Zhou
720dd07e79 Use render node for DRI3 if available
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
(ported from amdgpu commit ea558e645786b08d75307716036045170e97b43e)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
[ Second attempt, let's see if there's any fallout this time... ]
2016-12-19 17:27:19 +09:00
Michel Dänzer
92fc387a62 Simplify drmmode_handle_uevents
No functional change intended.

Reviewed-by: Jim Qu <Jim.Qu@amd.com>
(Cherry picked from amdgpu commit edd276185d42962a13faf9ec9eeebc754ef284e7.)
2016-12-15 12:44:47 +09:00
jimqu
404c647527 udev_monitor_receive_device() will block when hotplug monitor
udev_monitor_receive_device() will block and wait for the event of udev
use select() to ensure that this will not block.

Signed-off-by: JimQu <Jim.Qu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(Cherry picked from amdgpu commit 732cf4d3a248b288532ad0f3443da49e08dc7507)
2016-12-14 11:46:16 +09:00
Jochen Rollwagen
a89c0bced4 Calculate log base 2 in radeon.h based on clz for all platforms
This commit replaces the inline assembler code (for x86 platforms) and
loop (for non-x86 platforms) in RADEONLog2 with a one-liner version
based on clz (count leading zeroes).

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-12-05 11:06:28 +09:00
Michel Dänzer
e294244917 Call radeon_drm_abort_entry on failure to flip to a scanout pixmap
Fixes leaking the corresponding struct radeon_drm_queue list entry in
that case.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-30 15:33:07 +09:00
Michel Dänzer
14c3f59f51 Call ValidateGC after ChangeClip in radeon_sync_scanout_pixmaps
The wrong order meant that the clipping region wasn't actually applied,
so it always copied the full contents from the other scanout pixmap.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-30 15:32:31 +09:00
Michel Dänzer
a995f58309 Fix radeon_scanout_extents_intersect for GPU screens
Fixes incorrect screen updates with TearFree enabled on PRIME slave
outputs which are not located at (0, 0).

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-30 15:31:49 +09:00
Michel Dänzer
e543ef3a2f Take current scanout_id into account everywhere involved with TearFree
Fixes various potential issues with TearFree enabled, e.g. outputs
freezing after display configuration changes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-29 17:41:10 +09:00
Michel Dänzer
f130b10e63 Add radeon_is_gpu_screen helper
This will hopefully decrease the chance of accidentally breaking the
build against xserver < 1.13 in the future.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-25 18:12:40 +09:00
Jochen Rollwagen
487aa62a2a fix build for xserver < 1.13
same procedure every few patches.....

Fixes: 13c6bc5e38 ("Don't install Flush/EventCallback for GPU screens")
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-11-25 17:50:24 +09:00
Michel Dänzer
5fea5ef2f0 Pass fb_id into drmmode_page_flip_target_absolute/relative
drmmode->fb_id isn't what we need in the TearFree case. Fixes TearFree
freezing with

(WW) RADEON(0): flip queue failed in radeon_scanout_flip: No such file or directory

in the log file.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98834
Fixes: 1106b2f773 ("Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available")
2016-11-24 18:45:22 +09:00
Michel Dänzer
13c6bc5e38 Don't install Flush/EventCallback for GPU screens
Their purpose is to flush GPU rendering commands corresponding to damage
events, but there can be no damage events corresponding to GPU screen
rendering operations.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-22 16:25:48 +09:00
Michel Dänzer
f11531c99f Enable glamor by default with >= R600 and Xorg >= 1.18.3
glamor should now perform at least as well as EXA in general, and this
allows DRI3 to be enabled by default for >= R600.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-22 16:25:10 +09:00
Michel Dänzer
1106b2f773 Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-18 12:11:50 +09:00
Michel Dänzer
aab80d2203 Post-release version bump 2016-11-18 12:11:38 +09:00
Michel Dänzer
5cbe1ee8e4 Bump version for 7.8.0 release xf86-video-ati-7.8.0 2016-11-17 11:32:56 +09:00
Michel Dänzer
68023e0184 Update manpage entry for Option "TearFree"
It's now effective for arbitrary transforms as well.
2016-11-17 11:32:56 +09:00
Michel Dänzer
9760ef33cb Use pRADEONEnt to find both screens of a GPU in radeon_mode_hotplug
Fixes misbehaviour when hotplugging DisplayPort connectors on secondary
GPUs.

Fixes: c801f9f10a ("Handle Zaphod mode correctly in radeon_mode_hotplug")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98626
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-10 12:25:20 +09:00
Michel Dänzer
35bec4937d Refactor radeon_mode_hotplug
Preparation for the next change, no functional change intended.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-10 12:24:46 +09:00
Michel Dänzer
be9f67339a Reindent code in radeon_dri2_create_buffer2
Fixes warning about misleading indentation from recent versions of gcc:

../../src/radeon_dri2.c: In function ‘radeon_dri2_create_buffer2’:
../../src/radeon_dri2.c:224:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  if (flags & RADEON_CREATE_PIXMAP_TILING_MACRO)
  ^~
../../src/radeon_dri2.c:227:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      if (aligned_width == front_width)
      ^~

No functional change intended.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-09 16:02:11 +09:00
Michel Dänzer
350a2645a1 Check Xorg version at runtime instead of build time in two places
This means that all possible paths can be handled as intended, no matter
which Xorg version the driver happened to be compiled against.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-01 16:30:42 +09:00
Michel Dänzer
5df36de399 Require xserver 1.10 or newer
1.10.0 was released in February 2011.

We've been accidentally requiring 1.10 or newer since 121a6de72d ("Keep
track of damage event related flushes per-client v2").

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-27 11:40:13 +09:00
Michel Dänzer
22b5ce9548 Consume all available udev events at once
We get multiple udev events for actions like docking a laptop into its
station or plugging a monitor to the station. By consuming as many
events as we can, we reduce the number of output re-evalutions.

It depends on the timing how many events can be consumed at once.

(Inspired by xserver commit 363f4273dd4aec3e26cc57ecb6c20f27e6c813d8)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-26 16:00:09 +09:00
Hans de Goede
82d3c8f550 PRIME: Fix swapping of provider sink / source capabilities
When a card has import capability it can be an offload _sink_, not a
source and vice versa for export capability.

This went unnoticed sofar because most gpus have both import and export
capability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(Ported from xserver commit 94a1c77259ce39ba59ad87615df39b570ffab435)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-26 15:59:36 +09:00
Michel Dänzer
6c940446dd Always call PixmapStopDirtyTracking in drmmode_set_scanout_pixmap
Otherwise, we may leak screen->pixmap_dirty_list entries if
drmmode_set_scanout_pixmap is called repatedly with ppix != NULL, which
can happen from RRReplaceScanoutPixmap.

(Inspired by xserver commit b773a9c8126222e5fed2904d012fbf917a9f22fd)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-26 15:58:26 +09:00
Michel Dänzer
61df12e237 Don't rely on randr_crtc->scanout_pixmap in drmmode_set_scanout_pixmap
RRReplaceScanoutPixmap may set randr_crtc->scanout_pixmap = NULL before
we get here.

(Inspired by xserver commit f4c37eeee7953df1fe0e3196eda452acf0078e61)
v2: Always return TRUE in the if (!ppix) block.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2016-10-25 16:32:44 +09:00
Michel Dänzer
49cf3b5032 Sayōnara, AM_MAINTAINER_MODE!
If --enable-maintainer-mode got lost from config.status for any reason,
builds would fail in mysterious ways after changing between different
Git commits.

There are more reasons for dropping it in the automake manual:

https://www.gnu.org/software/automake/manual/html_node/maintainer_002dmode.html

I'm not aware of any reason why --disable-maintainer-mode would ever be
useful with this project.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-20 15:33:09 +09:00
Michel Dänzer
4b17de1cad Remove PCI IDs and bus type from ati_pciids.csv
This cleans up the list of unique chipsets a little further.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-19 18:09:14 +09:00
Michel Dänzer
1ce1b1656a Order unique chipsets according to first appearance in ati_pciids.csv
Instead of lexically. This makes it more likely for similar generations
to be close to each other in the list of unique chipsets.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-19 18:08:36 +09:00
Michel Dänzer
7c66be961d Enable HW cursor support with PRIME slave output & Xorg > 1.18.99.901
Supported since Xorg 1.18.99.2, but buggy until 1.18.99.901.

(Ported from amdgpu commit 7cc04035c55788261cda89a915c433c2add6cad9)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-19 18:05:42 +09:00
Michel Dänzer
d016f20b14 Restore location of radeon_set_pixmap_bo call in drmmode_create_bo_pixmap
radeon_set_pixmap_bo sets the tiling flags, so it needs to be called
before radeon_get_pixmap_tiling_flags. Fixes a regression with EXA and
TearFree.

Fixes: 8523a733b6 ("Propagate failure from radeon_set_pixmap_bo")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98097
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-13 16:36:22 +09:00
Michel Dänzer
937398f6cd Rotate and reflect cursor hotspot position for drmModeSetCursor2
We were always passing the hotspot position in the X screen coordinate
space, but drmModeSetCursor2 needs it in the CRTC coordinate space. The
wrong hotspot position would cause the kernel driver to adjust the
HW cursor position incorrectly when the hotspot position changed.

(Ported from amdgpu commit d42773eb45baff5933730e26878a0b45fcf07b65)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-06 18:52:37 +09:00
Michel Dänzer
3fc839ff49 Only list each unique chipset family once in the log file
(Ported from amdgpu commit 6a1ba044c2b71081e6060d0c096917d6238f2145)
2016-09-21 18:20:19 +09:00
Michel Dänzer
9a5eb1915a Clear damage in radeon_scanout_update if it doesn't intersect the CRTC
There's no need to test that same damage again.

(Ported from amdgpu commit a576430526cbc404de64b30e1377a356644e8024)
2016-09-21 18:20:19 +09:00
Michel Dänzer
792a30dbe5 Remove w/h parameters from radeon_scanout_extents_intersect
We can use the dimensions of the CRTC's mode instead.

(Ported from amdgpu commit ede7f2bcae63be65e05e3029bfe7c742e5978932)
2016-09-21 18:20:19 +09:00
Michel Dänzer
80d794f11a Make the dedicated scanout mechanism work with arbitrary transforms
This makes TearFree work with arbitrary transforms, and makes transforms
work better even without TearFree, with xserver >= 1.12.

(Ported from amdgpu commit bf000ea7ef91f5ecb59fc3c1ab8ed9eddcc0841d)
2016-09-21 18:20:19 +09:00
Michel Dänzer
09ba7b3b7b Remove drmmode_load_palette
Not used by any supported version of xserver.

(Ported from amdgpu commits 1091f28e1fa239ee1a973d84a8376fa4a95d7247
 and 5a4d3267ac3823fe58b51b0b9075b82375d7180c)
2016-09-21 18:20:19 +09:00
Michel Dänzer
730f443955 present: Separate checks for flips vs unflips
All unflip checks apply to flips as well, but not vice versa.

(Ported from amdgpu commit 4d506c23c9a628204fa23607931557b07ada3e31)
2016-09-21 18:20:19 +09:00
Michel Dänzer
343d286724 dri2: Don't allow flipping when using a dedicated scanout buffer
Fixes issues when mixing rotation and page flipping with current xserver
Git master.

(Ported from amdgpu commit decabd574f90d3df397c80ec931b3fde8a4afb49)
2016-09-21 18:20:19 +09:00
Michel Dänzer
83e4781d15 present: Don't allow flipping when using a dedicated scanout buffer
Fixes issues when mixing rotation and page flipping with current xserver
Git master.

(Ported from amdgpu commit 3ed28ce7cd26f89969617ba901ff253091d0d469)
2016-09-21 18:20:19 +09:00
Michel Dänzer
8419db3de6 Make sure drmmode_crtc->scanout[] are destroyed when not needed
We failed to do this when going back to scanning out directly from the
screen pixmap.

As a bonus, since we now destroy drmmode_crtc->scanout[] after setting
the new scanout buffer, we may avoid the CRTC turning off intermittently
in this case.

(Ported from amdgpu commit 9c3324715fd395fd486ea341654d78f4f298b97f)
2016-09-21 18:20:19 +09:00
Michel Dänzer
956e03d6a6 Simplify drmmode_set_mode_major error handling
Initialize ret = FALSE and only set it to TRUE when we've succeeded.

(Ported from amdgpu commit 3bce0519a4008cf87c0e31a7a579e10f5dcdd2f3)
2016-09-21 18:20:19 +09:00
Hans de Goede
ace455d1db Only add main fb if necessary
If we're doing reverse-prime; or doing rotation the main fb is not used,
and there is no reason to add it in this case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(Ported from xserver commit 4313122dea0df9affc280ee698e929489061ccc6)
(Ported from amdgpu commit a3ca1500703837cbb8d49c554199a25dea7d5e1e)
2016-09-21 18:20:19 +09:00