mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-23 17:19:21 +00:00
fix get vblank counter failed: Invalid argument
The error "get vblank counter failed: Invalid argument" occurs when drmWaitVBlank is called on a CRTC that is not enabled/active. The kernel returns EINVAL because you cannot get vblank counters for a disabled CRTC.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "amdgpu_bo_helper.h"
|
||||
#include "amdgpu_glamor.h"
|
||||
#include "amdgpu_pixmap.h"
|
||||
#include "amdgpu_video.h"
|
||||
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
|
||||
@@ -211,6 +212,9 @@ int drmmode_crtc_get_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc)
|
||||
ScrnInfoPtr scrn = crtc->scrn;
|
||||
uint32_t seq;
|
||||
|
||||
if (!amdgpu_crtc_is_enabled(crtc))
|
||||
return -1;
|
||||
|
||||
if (!drmmode_wait_vblank(crtc, DRM_VBLANK_RELATIVE, 0, 0, ust, &seq)) {
|
||||
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
|
||||
"get vblank counter failed: %s\n", strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user