summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-03-27 22:56:37 +0100
committerAlex Deucher <alexander.deucher@amd.com>2015-05-07 13:21:43 -0400
commitb69c5b3cc2d7da3bb85acd687db9b5a021258914 (patch)
treeff1a9d6953daaa7085083cb2687468033548f09b
parent91aa694a7da7b690a3e5d59a1a8fa42cbb3ebda4 (diff)
ddx: use amdgpu_query_crtc_from_id
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9e68d82..bb93833 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -688,17 +688,12 @@ void drmmode_crtc_hw_id(xf86CrtcPtr crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
ScrnInfoPtr pScrn = crtc->scrn;
- AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
- struct drm_amdgpu_info ginfo;
+ AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
int r;
- memset(&ginfo, 0, sizeof(ginfo));
- ginfo.return_pointer = (uintptr_t)&drmmode_crtc->hw_id;
- ginfo.return_size = sizeof(drmmode_crtc->hw_id);
- ginfo.query = AMDGPU_INFO_CRTC_FROM_ID;
- ginfo.mode_crtc.id = drmmode_crtc->mode_crtc->crtc_id;
- r = drmCommandWriteRead(info->dri2.drm_fd, DRM_AMDGPU_INFO, &ginfo,
- sizeof(ginfo));
+ r = amdgpu_query_crtc_from_id(pAMDGPUEnt->pDev,
+ drmmode_crtc->mode_crtc->crtc_id,
+ &drmmode_crtc->hw_id);
if (r)
drmmode_crtc->hw_id = -1;
}