summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-27Increase reference count of FB assigned to drmmode_crtc->flip_pendingMichel Dänzer
Otherwise, it could happen that we destroy the FB before the flip completes, resulting in use-after-free and most likely a crash. (Ported from amdgpu commit af7221e1c4d2dbdfd488eb0976a835584ea8441c) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-27Only call drmmode_scanout_free for non-GPU screens in LeaveVTMichel Dänzer
Destroying the scanout buffers of GPU screens resulted in a crash when switching back to the Xorg VT. Fixes: 4cfa4615f79f ("Use drmmode_crtc_scanout_* helpers for RandR 1.4 scanout pixmaps") Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-26Include xf86Pci.h for DRICreatePCIBusID with xserver Git masterMichel Dänzer
The declaration has been moved there from dri.h. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-15modesetting: Validate the atom for enum propertiesAdam Jackson
The client could have said anything here, and if what they said doesn't actually name an atom NameForAtom() will return NULL, and strcmp() will be unhappy about that. [copied from xserver d4995a3936ae283b9080fdaa0905daa669ebacfc] Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2017-05-18Update URLsMichel Dänzer
* Point to the amd-gfx mailing list * Specify the component in all bugzilla URLs * Use https:// for all HTML URLs Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-17Use plain glamor_egl_create_textured_screen().Eric Anholt
Since 5064ffab631 (2014), glamor's implementation of _ext just drops the back_pixmap arg, which we were passing NULL (the default) to anyway. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-05-11Remove unused struct members from drmmode_display.hMichel Dänzer
(Ported from amdgpu commit 462ac3341e5bfbded9086d3d9043821d19352b3e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-11Simplify tracking of PRIME scanout pixmapMichel Dänzer
Remember the shared pixmap passed to drmmode_set_scanout_pixmap for each CRTC, and just compare against that. Fixes leaving stale entries in ScreenRec::pixmap_dirty_list under some circumstances, which would usually result in use-after-free and a crash down the line. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-11Use reference counting for tracking KMS framebuffer lifetimesMichel Dänzer
References are held by the pixmaps corresponding to the FBs (so the same KMS FB can be reused as long as the pixmap exists) and by the CRTCs scanning out from them (so a KMS FB is only destroyed once it's not being scanned out anymore, preventing intermittent black screens and worse issues due to a CRTC turning off when it should be on). v2: * Only increase reference count in drmmode_fb_reference if it was sane before * Make drmmode_fb_reference's indentation match the rest of drmmode_display.h Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-11Pass pixmap instead of handle to radeon_do_pageflipMichel Dänzer
This brings us in line with amdgpu and prepares for the following change, no functional change intended. (Ported from amdgpu commit e463b849f3e9d7b69e64a65619a22e00e78d297b) v2: * Be more consistent with the amdgpu code, which should make porting the following change to amdgpu easier Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-09Apply gamma correction to HW cursorMichel Dänzer
The display hardware CLUT we're currently using for gamma correction doesn't affect the HW cursor, so we have to apply it manually when uploading the HW cursor data. This currently only works in depth 24/32. (Ported from amdgpu commit 82fa615f38137add75f9cd4bb49c48dd88de916f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-04-17Don't set modes before RADEONWindowExposures_oneshot is calledMichel Dänzer
The root window contents may be undefined before that, so we don't want to show anything yet. Fixes a crash on startup with rotation and virtual resolution set in xorg.conf. Bugzilla: https://bugs.freedesktop.org/100276 Fixes: cc9d6b7db9c2 ("Move DPMS check from radeon_scanout_do_update to radeon_scanout_flip") (Ported from amdgpu commit 981bac185cfd74ae50dffc28f57cf34623a9595f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-04-10Set correct DRM event context versionDaniel Stone
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by whatever version of libdrm is present. We were blindly asserting we supported whatever version that may be, even if we actually didn't. Set the version as 2, which should be bumped only with the appropriate version checks. Signed-off-by: Daniel Stone <daniels@collabora.com> (Ported from xserver commit 0c8e6ed85810e96d84173a52d628863802a78d82) v2: Remove second paragraph of commit log, we always initialize page_flip_handler2 = NULL (Emil Velikov) Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> # v1
2017-03-23manpage: Don't put "'" at the beginning of a lineMichel Dänzer
It caused the whole line to be dropped. Fixes: 58cd1600057e ("Allow toggling TearFree at runtime via output property") Reported-by: Andy Furniss <adf.lists@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (amdgpu commit) (Ported from amdgpu commit 165b51447643ce37f391f25ca6aecb8d76fabaa3)
2017-03-23Post-release version bumpMichel Dänzer
2017-03-16Bump version for 7.9.0 releasexf86-video-ati-7.9.0Michel Dänzer
2017-03-09Pass TRUE to drmmode_set_desired_modes the first time for GPU screensMichel Dänzer
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. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-08Skip some initialization steps for GPU screensMichel Dänzer
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 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-06Fix build for XServer 1.13Jochen Rollwagen
Latest git build stops with the error message radeon_kms.c: In function 'RADEONWindowExposures_oneshot': radeon_kms.c:1644:45: error: expected expression before 'RegionPtr' pScreen->WindowExposures(pWin, pRegion, RegionPtr pBSRegion); This patch fixes the build. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-03-02Don't call radeon_cs_flush_indirect & radeon_bo_wait in drmmode_copy_fbMichel Dänzer
RADEONWindowExposures_oneshot takes care of it. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-02Move DPMS check from radeon_scanout_do_update to radeon_scanout_flipMichel Dänzer
When radeon_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.
2017-03-02Call drmmode_set_desired_modes from a WindowExposures hookMichel Dänzer
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 RADEONUnblank -> 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 RADEONBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = RADEONBlockHandler_KMS. v2: * Drop spaces between XORG_VERSION_NUMERIC arguments * Call radeon_bo_wait after radeon_cs_flush_indirect Bugzilla: https://bugs.freedesktop.org/99457 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2017-03-02Fix bogus indentationMichel Dänzer
Trivial. Fixes: 58cd1600057e ("Allow toggling TearFree at runtime via output property")
2017-03-01present: Flush before flippingMichel Dänzer
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. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-01present: Use async flip for unflip if possibleMichel Dänzer
In that case, unflip operations should finish faster in general. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-01present: Also flush before using a flip to unflipMichel Dänzer
Not doing so might result in intermittently scanning out stale contents of the screen pixmap. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-01Handle rotation in the driver also with Xorg 1.12-1.18Michel Dänzer
We cannot use the HW cursor in that case, but in turn we get more efficient and less teary updates of rotated outputs. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-01Fold drmmode_crtc_scanout_allocate into drmmode_crtc_scanout_createMichel Dänzer
Not used anywhere else anymore. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-28Call drmmode_crtc_scanout_create in drmmode_crtc_shadow_allocate as wellMichel Dänzer
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: ea30d856ba5e ("Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap") Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-22present: Wait for screen pixmap BO idle before setting modes for unflipMichel Dänzer
To make sure the screen pixmap contents are up to date when it starts being scanned out. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-22present: Only call drmModeRmFB after setting modes for unflipMichel Dänzer
Fixes display intermittently blanking when a modeset is used for unflip. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-22Use drmmode_crtc_scanout_free in drmmode_finiMichel Dänzer
We were leaking drmmode_crtc->scanout_damage, which caused trouble on server reset. Fixes server reset with active separate scanout pixmaps. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-22Allow toggling TearFree at runtime via output propertyMichel Dänzer
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. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-22Factor out drmmode_crtc_scanout_update helperMichel Dänzer
Cleanup in preparation for following change, no functional change intended. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-14Factor out radeon_prime_dirty_to_crtc helperMichel Dänzer
Cleanup in preparation for the following change, no functional change intended. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08Don't destroy current FB if drmModeAddFB failsMichel Dänzer
It would probably result in a black screen. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08Fix flip event data leak if calloc or drmModeAddFB failsMichel Dänzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-31Don't handle Option "SwapbuffersWait" at all with glamorMichel Dänzer
It never had any effect with glamor. v2: Better formatting, no functional change from v1. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2017-01-26Enable tiling by default with glamor on PALMMichel Dänzer
The DFS check is only relevant for EXA. The lack of tiling prevented DRI3 clients from using page flipping, resulting in tearing. Bugzilla: https://bugs.freedesktop.org/99491 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-26Add 10-radeon.conf xorg.conf.d snippetMichel Dänzer
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-26autogen: add default patch prefixMihail Konev
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov
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-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer
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-24ati: Support loading the amdgpu driver from the ati wrapperMichel Dänzer
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.editorconfig: src/ati.c only uses spaces for indentationMichel Dänzer
Trivial.
2017-01-06Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmapMichel Dänzer
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: 040a7b80e1fc ("Explicitly set the fbcon pixmap pitch again") Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-19Use render node for DRI3 if availableJammy Zhou
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-15Simplify drmmode_handle_ueventsMichel Dänzer
No functional change intended. Reviewed-by: Jim Qu <Jim.Qu@amd.com> (Cherry picked from amdgpu commit edd276185d42962a13faf9ec9eeebc754ef284e7.)
2016-12-14udev_monitor_receive_device() will block when hotplug monitorjimqu
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-05Calculate log base 2 in radeon.h based on clz for all platformsJochen Rollwagen
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>