<div dir="ltr">Hello Team,<div><br></div><div>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. </div><div><br></div><div>I have made the modifications in xserver/modesetting but when i launch the application(DOTA2), below condition gets failed </div><div><a href="https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/blob/master/src/amdgpu_kms.c#L110">https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/blob/master/src/amdgpu_kms.c#L110</a> </div><div><br></div><div>As per the code, i had a confusion that this condition will never met. </div><div><br></div><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>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()). </b></p>

<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>Below actions will happen in ms_change_property() </b></p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>1.
Create Local WindowPtr and copy the data from Stuff->window to this
WindowPtr</b></p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>2. Call
amdgpu_vrr_property_update() based on the property set in Stuff by passing the
WindowPtr to it.</b></p>

<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>    a. Read Private Keys for WindowPtr in amdgpu_vrr_property_update(). </b></p>

<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>    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 ? </b></p>

<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>Why ?</b></p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b>info<span style="font-size:11pt">->flip_window gets updated with window (WindowPtr) in </span>amdgpu_present_check_flip<span style="font-size:11pt">() 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.</span><span style="font-family:Arial,Helvetica,sans-serif;font-size:small"> </span></b></p><div><br></div><div>Can  you please help me in understanding on this ? </div><div><br></div><div>JFYI, I have used DOTA2 application to verify this feature.</div><div><br></div><div>Thanka</div><div>Uday Kiran</div><div><br></div><div><br></div><div><br></div></div>