On 04.08.2016 17:22, Christian König wrote: > Am 04.08.2016 um 08:41 schrieb Michel Dänzer: >> On 03.08.2016 10:04, Dave Airlie wrote: >>> On 2 August 2016 at 12:26, Hawking Zhang <Hawking.Zhang at amd.com> wrote: >>>> >>>> @@ -706,4 +708,17 @@ struct drm_amdgpu_virtual_range { >>>> uint64_t start; >>>> uint64_t end; >>>> }; >>>> + >>>> +/* >>>> + * Definition of free sync enter and exit signals >>>> + * We may have more options in the future >>>> + */ >>>> +#define AMDGPU_FREESYNC_FULLSCREEN_ENTER 1 >>>> +#define AMDGPU_FREESYNC_FULLSCREEN_EXIT 2 >>>> + >>>> +struct drm_amdgpu_freesync { >>>> + __u32 op; /* >>>> AMDGPU_FREESYNC_FULLSCREEN_ENTER or */ >>>> + /* >>>> AMDGPU_FREESYNC_FULLSCREEN_ENTER */ >>>> + __u32 spare[7]; >>>> +}; >>>> #endif >>> Isn't freesync meant to be a generic non-driver useful thing? >>> >>> This should be integrated with atomic modesetting API or just the KMS >>> APIs. >> I don't see that as required or even particularly useful until there's >> an API which apps can use to control variable refresh rate. > > VDPAU already does this quite well [...] By explicitly specifying the earliest presentation time for each frame AFAICT? While that seems very flexible, I'm not sure it's particularly good for smooth and stable playback. Seems like overriding the refresh rate to (a multiple of) the video frame rate might be better for that. >> The goal >> here is merely to allow running existing apps with variable refresh >> rate, which just requires some kind of toggle(s) to enable/disable it. >> >> >> That said, I also see some issues with this patch: >> >> There's a bit of a conflation between "FreeSync" and "fullscreen" >> concepts. I think at this point it's really about a sort of an "is >> FreeSync allowed?" state rather than about fullscreen. > > I would say we first of all need a new flag for drm_mode_modeinfo to > note if a certain mode is a freesync mode or not and what the min/max > parameters are. > >> >> It might be nice to track the "is FreeSync allowed?" state per-CRTC, as >> I wonder if FreeSync might be useful e.g. for smoother TearFree >> operation. >> >> And if it's just a per-CRTC state, something like an output property >> might be more appropriate than a dedicated ioctl. > > That will obvious work as well, but essentially freesync is a parameter > of the video mode in use if I'm not completely mistaken. Hmm, that's an interesting point. Enabling FreeSync via special modes sounds quite natural from a user POV. Unfortunately, games tend to only let the user choose a resolution, not a specific mode. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer