summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-03-10Pass TRUE to drmmode_set_desired_modes the first time for GPU screensMichel Dänzer1-1/+2
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 <alexander.deucher@amd.com>
2017-03-09Skip some initialization steps for GPU screensMichel Dänzer2-41/+51
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 <alexander.deucher@amd.com>
2017-03-07glamor: Use glamor_finish when availableMichel Dänzer1-0/+7
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07amdgpu_probe: Do not close server managed drm fdsHans De Goede1-4/+4
This fixes the xserver only seeing AMD/ATI devices supported by the amdgpu driver, as by the time xf86-video-ati gets a chance to probe them, the fd has been closed. This fixes e.g. Xorg not seeing the dGPU on a Lenovo Thinkpad E465 laptop with a CARRIZO iGPU and a HAINAN dGPU. Signed-off-by: Hans de Goede <hdegoede@redhat.com> v2: Rebased on top of new patch 1. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Refactor amdgpu_kernel_close_fd helperMichel Dänzer3-6/+13
Preparation for the following change. Assign pAMDGPUEnt->fd = -1 instead of 0 when we're not using the file descriptor anymore. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07glamor: Don't flush in BlockHandler with Xorg >= 1.19Michel Dänzer1-0/+2
This was only necessary with older versions for driving the FBO cache expiry mechanism. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Only define transform_region for XF86_CRTC_VERSION >= 4Michel Dänzer1-0/+4
Not used with older versions of Xorg. Fixes warning in that case: ../../src/amdgpu_kms.c:328:1: warning: ‘transform_region’ defined but not used [-Wunused-function] transform_region(RegionPtr region, struct pict_f_transform *transform, ^~~~~~~~~~~~~~~~ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Use local implementation of RegionDuplicate for older xserverMichel Dänzer1-0/+19
It was only added in xserver 1.15. Fixes build against older xserver. Reported-by: Pali Rohár <pali.rohar@gmail.com> (Ported from radeon commit 80cc892ee1ce54fad3cb7dd11bd9df18c359136f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Don't use pScrn->is_gpu in AMDGPUCreateScreenResources_KMSMichel Dänzer1-1/+1
Looks like this snuck in accidentally. Brings us back in line with the radeon driver, and fixes the build against older versions of xserver which didn't have the is_gpu field yet. Fixes: 6bab8fabb37e ("Remove info->dri2.drm_fd and info->drmmode->fd") Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Don't call amdgpu_glamor_flush in drmmode_copy_fbMichel Dänzer1-2/+0
AMDGPUWindowExposures_oneshot takes care of it. (Ported from radeon commit d63881623f0686a66a2e3e3c1f84e496aa52ec6b) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Move DPMS check from amdgpu_scanout_do_update to amdgpu_scanout_flipMichel Dänzer1-2/+2
When amdgpu_scanout_do_update is called from drmmode_crtc_scanout_update, drmmode_crtc->pending_dpms_mode may still be != DPMSModeOn, e.g. during server startup. Fixes intermittently showing garbage with TearFree enabled. (Ported from radeon commit cc9d6b7db9c2078be1e530a64af6d517c6a42024) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07Call drmmode_set_desired_modes from a WindowExposures hookMichel Dänzer2-12/+29
This is the earliest opportunity where the root window contents are guaranteed to be initialized, and prevents drmmode_set_mode_major from getting called before drmmode_set_desired_modes via AMDGPUUnblank -> drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is called when running Xorg with -pogo. Fixes intermittently showing garbage on server startup or after server reset. As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc Xorg module) calling AMDGPUBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = AMDGPUBlockHandler_KMS. Bugzilla: https://bugs.freedesktop.org/99457 (Ported from radeon commits 0a12bf1085505017068dfdfd31d23133e51b45b9 and f0e7948e1c0e984fc27f235f365639e9cf628291) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07present: Flush before flippingMichel Dänzer1-0/+2
This isn't necessary for DRI clients, but the Present extension can also be used for presenting normal pixmaps rendered to via the X11 protocol. (Ported from radeon commit 9035b6abea557828e672ee455f0c84e43da0906f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07present: Use async flip for unflip if possibleMichel Dänzer1-1/+6
In that case, unflip operations should finish faster in general. (Ported from radeon commit 0a4eb0e12f0c9c653cf4cea6fd62e1a507eb261c) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07present: Also flush before using a flip to unflipMichel Dänzer1-0/+1
Not doing so might result in intermittently scanning out stale contents of the screen pixmap. (Ported from radeon commit 9a951a3e551db58ba50e7a594521ceac54d90615) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07present: Wait for GPU idle before setting modes for unflipMichel Dänzer1-0/+1
To make sure the screen pixmap contents are up to date when it starts being scanned out. (Ported from radeon commit 244d4bc7f8c8f6bc90f49556c0b9344c8aa40295) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-07present: Only call drmModeRmFB after setting modes for unflipMichel Dänzer1-1/+3
Fixes display intermittently blanking when a modeset is used for unflip. (Ported from radeon commit 3ff29e5a14451916bc66b4e0028e9a317f0723f8) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Use drmmode_crtc_scanout_free in drmmode_finiMichel Dänzer1-7/+2
We were leaking drmmode_crtc->scanout_damage, which caused trouble on server reset. Fixes server reset with active separate scanout pixmaps. (Cherry picked from radeon commit 0c29deb5a97d9a57e994cc0053c49ddf7aca6ecb) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Allow toggling TearFree at runtime via output propertyMichel Dänzer5-47/+210
Option "TearFree" now sets the default value of the output property. See the manpage update for details. TearFree is now enabled by default for outputs using rotation or other RandR transforms, and for RandR 1.4 slave outputs. (Ported from radeon commit 58cd1600057e41aade0106d4acf78e23eac6e44f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Factor out drmmode_crtc_scanout_update helperMichel Dänzer1-36/+49
Cleanup in preparation for following change, no functional change intended. (Ported from radeon commit 305e2cbf335837a2ab6a24e9ff65815afe038296) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Factor out amdgpu_prime_dirty_to_crtc helperMichel Dänzer1-29/+33
Cleanup in preparation for the following change, no functional change intended. (Ported from radeon commit 649644a88347a6d03de68f8c41db03a82deeb23b) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Don't destroy current FB if drmModeAddFB failsMichel Dänzer1-1/+2
It would probably result in a black screen. (Ported from radeon commit 1351e48efe7a2c28eab447e16f36a00fbd02ae48) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Fix flip event data leak if calloc or drmModeAddFB failsMichel Dänzer2-3/+5
(Ported from radeon commit 481394e3c9f9f7d88bb66fe9ae8834c87952a8ab) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Handle rotation in the driver also with Xorg 1.12-1.18Michel Dänzer1-7/+5
We cannot use the HW cursor in that case, but in turn we get more efficient and less teary updates of rotated outputs. (Ported from radeon commit f2bc882f1c1082bed9f496cfab6c8f07a76bc122) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03Fold drmmode_crtc_scanout_allocate into drmmode_crtc_scanout_createMichel Dänzer1-49/+22
Not used anywhere else anymore. (Ported from radeon commit ae921a3150f69c38b5b3c88a9e37d54fdf0d5093) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-02Call drmmode_crtc_scanout_create in drmmode_crtc_shadow_allocate as wellMichel Dänzer1-10/+17
Calling drmmode_crtc_scanout_allocate in drmmode_crtc_shadow_allocate resulted in drmmode_crtc_scanout_create called from drmmode_crtc_shadow_create passing an uninitialized pitch value to drmmode_create_bo_pixmap. Fixes issues such as failure to allocate the scanout pixmap or visual corruption and GPUVM faults when attempting to use rotation with Xorg <1.19. Bugzilla: https://bugs.freedesktop.org/99916 Fixes: 5f7123808833 ("Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap") (Ported from radeon commit 987a34adb319923ad36e2b47a26837248f187c3e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-06Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmapMichel Dänzer1-12/+10
Mostly to align with radeon commit ea30d856ba5e7274c8ea499293b8b0e721b8e082, but also gets rid of a gbm_bo_get_stride call. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-19Use render node for DRI3 if availableJammy Zhou2-3/+35
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> [ Second attempt, let's see if there's any fallout this time... ]
2016-12-15Simplify drmmode_handle_ueventsMichel Dänzer1-10/+4
No functional change intended. Reviewed-by: Jim Qu <Jim.Qu@amd.com>
2016-12-14udev_monitor_receive_device() will block when hotplug monitorjimqu1-3/+19
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>
2016-12-01Call amdgpu_drm_abort_entry on failure to flip to a scanout pixmapMichel Dänzer1-0/+2
Fixes leaking the corresponding struct amdgpu_drm_queue list entry in that case. (Ported from radeon commit e2942449171fe628a7726e59bcaab65e27d88563) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-01Call ValidateGC after ChangeClip in amdgpu_sync_scanout_pixmapsMichel Dänzer1-1/+1
The wrong order meant that the clipping region wasn't actually applied, so it always copied the full contents from the other scanout pixmap. (Ported from radeon commit 14c3f59f5157885ad8f941f0bad6c0c5e3db12f8) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-01Fix amdgpu_scanout_extents_intersect for GPU screensMichel Dänzer1-5/+15
Fixes incorrect screen updates with TearFree enabled on PRIME slave outputs which are not located at (0, 0). (Ported from radeon commit a995f5830916a0fee5126263d1bfe48632be3a15) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-30Take current scanout_id into account everywhere involved with TearFreeMichel Dänzer3-15/+14
Fixes various potential issues with TearFree enabled, e.g. outputs freezing after display configuration changes. (Ported from radeon commit e543ef3a2fb304cbe3a965fb780632af2e4186f4) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-28Add amdgpu_is_gpu_screen helperMichel Dänzer3-15/+8
This will hopefully decrease the chance of accidentally breaking the build against xserver < 1.13 in the future. (Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-28Don't install Flush/EventCallback for GPU screensMichel Dänzer1-2/+6
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. (Ported from radeon commits 13c6bc5e382765fe567091e1c616c0a26eec04ca and 487aa62a2a23b86e4ea4714fdfd465c9e513141f) v2: Squash in radeon fix for build against xserver < 1.13 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2016-11-28Make libdrm >= 2.4.72 requirement explicitMichel Dänzer2-17/+0
And drop compatibility code for older versions. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-22Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when availableMichel Dänzer6-25/+104
(Ported from radeon commits 1106b2f773ad0611c729b27f4c192a26b43ef1e7 and 5fea5ef2f07eee4a0f94baab427010b936f1d4b4) v2: * Squash in radeon fix for TearFree regression * Remove preprocessor guards for compatibility with libdrm < 2.4.72 (Emil Velikov) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-21Remove generated header filesMichel Dänzer9-1301/+0
No longer used. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-21Stop using AMDGPU(Unique)ChipsetsMichel Dänzer2-13/+10
Use libdrm_amdgpu's amdgpu_get_marketing_name for the chipset name, or "Unknown AMD Radeon GPU" as a fallback. v2: Require libdrm_amdgpu >= 2.4.72 for amdgpu_get_marketing_name Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2016-11-21Stop using AMDGPUPciChipsetsMichel Dänzer1-3/+1
Not actually used by Xorg. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-21Remove amdpciids.hMichel Dänzer4-45/+2
Not useful anymore. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-21Stop using generated amdgpu_device_matchMichel Dänzer1-3/+6
Just match on PCI device ID 0x1002. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-21Use family information from libdrm_amdgpu / kernelMichel Dänzer2-14/+6
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-21Move struct amdgpu_gpu_info out of amdgpu_get_tile_configMichel Dänzer1-10/+8
Preparation for the following change, no functional change intended. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-16Use pAMDGPUEnt to find both screens of a GPU in amdgpu_mode_hotplugMichel Dänzer3-15/+15
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 <alexander.deucher@amd.com>
2016-11-10Refactor amdgpu_mode_hotplugMichel Dänzer1-24/+33
Preparation for the next change, no functional change intended. (Cherry picked from radeon commit 35bec4937d89b48a79acfcb4f814b7370cb631b2) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-02Check Xorg version at runtime instead of build time in two placesMichel Dänzer2-9/+5
This means that all possible paths can be handled as intended, no matter which Xorg version the driver happened to be compiled against. (Ported from radeon commit 350a2645a1b127227ff294c0b62d20000d0fd48a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-02Require xserver 1.10 or newerMichel Dänzer5-22/+0
1.10.0 was released in February 2011. We've been accidentally requiring 1.10 or newer since c7d27c94cb65 ("Keep track of damage event related flushes per-client"). (Ported from radeon commit 5df36de39952c3a26cb2fbc125f298139a9dd5bc) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-27present: Check tiling info for flipsMichel Dänzer1-0/+7
The kernel driver doesn't handle flipping between buffers with different tiling parameters correctly. Fixes display corruption with fullscreen apps using different tiling modes (e.g. due to R600_DEBUG=notiling or R600_DEBUG=no2d) via DRI3. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>