Reg. Adaptive Sync feature in xf86-video-amdgpu
Michel Dänzer
michel at daenzer.net
Mon Apr 20 14:44:15 UTC 2020
On 2020-04-20 6:12 a.m., uday kiran pichika wrote:
> Hello Team,
>
> I'm working on adding Adaptive Sync feature in Xserver/modesetting. When
> understanding the existing AMD's implementation, I've few doubts regarding
> the vrr property being set on the Window from MESA.
>
> I have made the modifications in xserver/modesetting but when i launch the
> application(DOTA2), below condition gets failed
> https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/blob/master/src/amdgpu_kms.c#L110
BTW, one should always use a specific Git commit for this kind of
reference, otherwise it will tend to point to unrelated code or even
nirvana as time passes.
> As per the code, i had a confusion that this condition will never met.
>
> *I had analysed the code and here is the analysis made when the flip
> happens in xserver When full screen gaming application is opened,
> variable_refresh property is being set in MESA and xserver will get
> notified with amdgpu_change_property() method(Same method we registered
> with the client during AMDGPUScreenInit_KMS()). *
>
> *Below actions will happen in ms_change_property() *
>
> *1. Create Local WindowPtr and copy the data from Stuff->window to this
> WindowPtr*
>
> *2. Call amdgpu_vrr_property_update() based on the property set in Stuff by
> passing the WindowPtr to it.*
>
> * a. Read Private Keys for WindowPtr in amdgpu_vrr_property_update(). *
>
> * b. Compare info->flip_window and this WindowPtr and make a call to
> amdgpu_present_set_screen_vrr(). → But this method will never gets called
> due to the condition mismatch every time. Why ? *
>
> *Why ?*
>
> *info->flip_window gets updated with window (WindowPtr)
> in amdgpu_present_check_flip() when amdgpu_present_flip() method gets
> called from DIX. This pointer will never same as the WindowPtr created in
> amdgpu_change_property() and variable_refresh flag is being set for in
> amdgpu_change_property() WindowPtr only. *
>
> Can you please help me in understanding on this ?
This code in amdgpu_vrr_property_update is for the case when the
ChangeProperty request is called for a window which is already flipping.
In the case you're looking at, the window only starts flipping later,
and the KMS property is enabled from amdgpu_present_flip =>
amdgpu_present_set_screen_vrr.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list