[PATCH xf86-video-amdgpu] Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michel,

On 22 November 2016 at 07:58, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> (Ported from radeon commit 1106b2f773ad0611c729b27f4c192a26b43ef1e7)
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---

> +static Bool drmmode_probe_page_flip_target(AMDGPUEntPtr pAMDGPUEnt)
> +{
> +#ifdef DRM_CAP_PAGE_FLIP_TARGET
> +       uint64_t cap_value;
> +
> +       return drmGetCap(pAMDGPUEnt->fd, DRM_CAP_PAGE_FLIP_TARGET,
> +                        &cap_value) == 0 && cap_value != 0;
> +#else
> +       return FALSE;
> +#endif
Since the ABI is already set, it would be better to add a fallback
define and always use drmGetCap. The latter will (should?) return !=
0, thus things will work as expected.
Atm there's a hidden dependency on DRM_CAP_PAGE_FLIP_TARGET aware
libdrm(?). Without the above one will need to rebuild the DDX after
updating libdrm.

> +}
> +
> +static int
> +drmmode_page_flip(AMDGPUEntPtr pAMDGPUEnt, drmmode_crtc_private_ptr drmmode_crtc,
> +                 uint32_t flags, uintptr_t drm_queue_seq)
> +{
> +       drmmode_ptr drmmode = drmmode_crtc->drmmode;
> +
> +       flags |= DRM_MODE_PAGE_FLIP_EVENT;
> +       return drmModePageFlip(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id,
> +                              drmmode->fb_id, flags, (void*)drm_queue_seq);
> +}
> +
> +int
> +drmmode_page_flip_target_absolute(AMDGPUEntPtr pAMDGPUEnt,
> +                                 drmmode_crtc_private_ptr drmmode_crtc,
> +                                 uint32_t flags, uintptr_t drm_queue_seq,
> +                                 uint32_t target_msc)
> +{
> +#ifdef DRM_MODE_PAGE_FLIP_TARGET
> +       if (pAMDGPUEnt->has_page_flip_target) {
With the above in mind - here (and in *relative) you can drop the guards.

Emil


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux