<div dir="ltr">Thanks for the information Michel. <div><br><div>Even in amdgpu_present_flip(), there is a check for amdgpu_window_has_variable_refresh() which actually checks whether window has a variable_refresh property set from the MESA or not ? this check is failing in my case and never calls amdgpu_present_set_screen_vrr. Is there any way that i can check whether MESA is setting this property ?</div><div><br></div><div>To my understanding, MESA will set this property to true or false based on whether application is running in Full screen mode or in normal mode.  Please correct me if I am wrong. </div></div><div><br></div><div>Thanks </div><div>Uday Kiran</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 8:14 PM Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2020-04-20 6:12 a.m., uday kiran pichika wrote:<br>
> Hello Team,<br>
> <br>
> I'm working on adding Adaptive Sync feature in Xserver/modesetting. When<br>
> understanding the existing AMD's implementation, I've few doubts regarding<br>
> the vrr property being set on the Window from MESA.<br>
> <br>
> I have made the modifications in xserver/modesetting but when i launch the<br>
> application(DOTA2), below condition gets failed<br>
> <a href="https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/blob/master/src/amdgpu_kms.c#L110" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/blob/master/src/amdgpu_kms.c#L110</a><br>
<br>
BTW, one should always use a specific Git commit for this kind of<br>
reference, otherwise it will tend to point to unrelated code or even<br>
nirvana as time passes.<br>
<br>
<br>
> As per the code, i had a confusion that this condition will never met.<br>
> <br>
> *I had analysed the code and here is the analysis made when the flip<br>
> happens in xserver When full screen gaming application is opened,<br>
> variable_refresh property is being set in MESA and xserver will get<br>
> notified with amdgpu_change_property() method(Same method we registered<br>
> with the client during AMDGPUScreenInit_KMS()). *<br>
> <br>
> *Below actions will happen in ms_change_property() *<br>
> <br>
> *1. Create Local WindowPtr and copy the data from Stuff->window to this<br>
> WindowPtr*<br>
> <br>
> *2. Call amdgpu_vrr_property_update() based on the property set in Stuff by<br>
> passing the WindowPtr to it.*<br>
> <br>
> *    a. Read Private Keys for WindowPtr in amdgpu_vrr_property_update(). *<br>
> <br>
> *    b. Compare info->flip_window and this WindowPtr and make a call to<br>
> amdgpu_present_set_screen_vrr().  → But this method will never gets called<br>
> due to the condition mismatch every time. Why ? *<br>
> <br>
> *Why ?*<br>
> <br>
> *info->flip_window gets updated with window (WindowPtr)<br>
> in amdgpu_present_check_flip() when amdgpu_present_flip() method gets<br>
> called from DIX. This pointer will never same as the WindowPtr created in<br>
> amdgpu_change_property() and variable_refresh flag is being set for in<br>
> amdgpu_change_property() WindowPtr only. *<br>
> <br>
> Can  you please help me in understanding on this ?<br>
<br>
This code in amdgpu_vrr_property_update is for the case when the<br>
ChangeProperty request is called for a window which is already flipping.<br>
<br>
In the case you're looking at, the window only starts flipping later,<br>
and the KMS property is enabled from amdgpu_present_flip =><br>
amdgpu_present_set_screen_vrr.<br>
<br>
<br>
-- <br>
Earthling Michel Dänzer               |               <a href="https://redhat.com" rel="noreferrer" target="_blank">https://redhat.com</a><br>
Libre software enthusiast             |             Mesa and X developer<br>
</blockquote></div>