diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2015-10-28 17:44:09 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2015-10-30 18:32:55 +0900 |
commit | 6bab8fabb37eb131e131ce59446c214ded28f779 (patch) | |
tree | 4cc7c03c004ed74cb16e89d706c00b3433954b0e /src/amdgpu_present.c | |
parent | 0530e39cc6b7340163e7f6bb6d82719d102ee6e9 (diff) |
Remove info->dri2.drm_fd and info->drmmode->fd
Use pAMDGPUEnt->fd everywhere instead.
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'src/amdgpu_present.c')
-rw-r--r-- | src/amdgpu_present.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c index 5e5ed72..07d7ef7 100644 --- a/src/amdgpu_present.c +++ b/src/amdgpu_present.c @@ -104,10 +104,11 @@ static Bool amdgpu_present_flush_drm_events(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[0]->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; - struct pollfd p = { .fd = drmmode->fd, .events = POLLIN }; + struct pollfd p = { .fd = pAMDGPUEnt->fd, .events = POLLIN }; int r; do { @@ -117,7 +118,7 @@ amdgpu_present_flush_drm_events(ScreenPtr screen) if (r <= 0) return 0; - return drmHandleEvent(drmmode->fd, &drmmode->event_context) >= 0; + return drmHandleEvent(pAMDGPUEnt->fd, &drmmode->event_context) >= 0; } /* @@ -154,7 +155,7 @@ amdgpu_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) xf86CrtcPtr xf86_crtc = crtc->devPrivate; ScreenPtr screen = crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - AMDGPUInfoPtr info = AMDGPUPTR(scrn); + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); int crtc_id = drmmode_get_crtc_id(xf86_crtc); struct amdgpu_present_vblank_event *event; struct amdgpu_drm_queue_entry *queue; @@ -178,7 +179,7 @@ amdgpu_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) vbl.request.sequence = msc; vbl.request.signal = (unsigned long)queue; for (;;) { - ret = drmWaitVBlank(info->dri2.drm_fd, &vbl); + ret = drmWaitVBlank(pAMDGPUEnt->fd, &vbl); if (!ret) break; if (errno != EBUSY || !amdgpu_present_flush_drm_events(screen)) { @@ -397,11 +398,11 @@ amdgpu_present_has_async_flip(ScreenPtr screen) { #ifdef DRM_CAP_ASYNC_PAGE_FLIP ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - AMDGPUInfoPtr info = AMDGPUPTR(scrn); + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); int ret; uint64_t value; - ret = drmGetCap(info->dri2.drm_fd, DRM_CAP_ASYNC_PAGE_FLIP, &value); + ret = drmGetCap(pAMDGPUEnt->fd, DRM_CAP_ASYNC_PAGE_FLIP, &value); if (ret == 0) return value == 1; #endif |