<div dir="ltr"><br><br>On Wed, Jan 11, 2017 at 9:25 PM, Andy Furniss <<a href="mailto:adf.lists@gmail.com" target="_blank">adf.lists@gmail.com</a>> wrote:<br>> Nayan Deshmukh wrote:<br>>><br>>> Hi Andy,<br>>><br>>> Can you try this patch? This should help with the tearing.<br>><br>><br>> Patch seems to be good - I get page flipping again so DC, modesetting<br>> and "normal" setup all work OK.<br>><div>Great.</div><div><br></div><div>Thanks for the help Michel.</div><div><br></div><div>Christian, I will resend the series with the changes. Please review the other 2</div><div>patches.</div><div><br></div><div>Regards,</div><div>Nayan<br>><br>>><br>>> diff --git a/src/gallium/state_trackers/<wbr>vdpau/output.c<br>>> b/src/gallium/state_trackers/<wbr>vdpau/output.c<br>>> index 48e3133..98a8011 100644<br>>> --- a/src/gallium/state_trackers/<wbr>vdpau/output.c<br>>> +++ b/src/gallium/state_trackers/<wbr>vdpau/output.c<br>>> @@ -82,7 +82,7 @@ vlVdpOutputSurfaceCreate(<wbr>VdpDevice device,<br>>>      res_tmpl.depth0 = 1;<br>>>      res_tmpl.array_size = 1;<br>>>      res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET |<br>>> -                   PIPE_BIND_SHARED;<br>>> +                   PIPE_BIND_SHARED | PIPE_BIND_SCANOUT;<br>>>      res_tmpl.usage = PIPE_USAGE_DEFAULT;<br>>><br>>>      pipe_mutex_lock(dev->mutex);<br>>><br>>> Regards,<br>>> Nayan<br>>><br>>> On Wed, Jan 11, 2017 at 5:11 PM, Andy Furniss <<a href="mailto:adf.lists@gmail.com" target="_blank">adf.lists@gmail.com</a>> wrote:<br>>>><br>>>> Michel Dänzer wrote:<br>>>>><br>>>>><br>>>>> On 11/01/17 05:13 PM, Nayan Deshmukh wrote:<br>>>>>><br>>>>>><br>>>>>> On Wed, Jan 11, 2017 at 12:44 PM, Michel Dänzer <<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>><br>>>>>> wrote:<br>>>>>>><br>>>>>>><br>>>>>>> On 10/01/17 06:53 PM, Nayan Deshmukh wrote:<br>>>>>>>><br>>>>>>>><br>>>>>>>> On Sat, Jan 7, 2017 at 12:42 PM, Michel Dänzer <<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>><br>>>>>>>> wrote:<br>>>>>>>>><br>>>>>>>>><br>>>>>>>>> On 06/01/17 05:50 AM, Andy Furniss wrote:<br>>>>>>>>>><br>>>>>>>>>><br>>>>>>>>>> Christian König wrote:<br>>>>>>>>>>><br>>>>>>>>>>><br>>>>>>>>>>> Am 04.01.2017 um 18:13 schrieb Nayan Deshmukh:<br>>>>>>>>>>>><br>>>>>>>>>>>><br>>>>>>>>>>>> dri3 allows us to send handle of a texture directly to X<br>>>>>>>>>>>> so this patch allows a state tracker to directly send its<br>>>>>>>>>>>> texture to X to be used as back buffer and avoids extra<br>>>>>>>>>>>> copying<br>>>>>>>>>>>><br>>>>>>>>>>>> v2: use clip width/height to display a portion of the surface<br>>>>>>>>>>>> v3: remove redundant variables, fix wrapping, rename variables<br>>>>>>>>>>>>        handle vaapi path<br>>>>>>>>>>>> v3.1: we need clip_width/height for every frame so we don't need<br>>>>>>>>>>>>          to maintain it for each buffer instead use a global<br>>>>>>>>>>>> variable<br>>>>>>>>>>>> v4: In case of single gpu we can cache the buffers as<br>>>>>>>>>>>> applications<br>>>>>>>>>>>>        use constant number of buffer and we can avoid calls to<br>>>>>>>>>>>> present<br>>>>>>>>>>>>        extension for every frame<br>>>>>>>>>>>><br>>>>>>>>>>>> Suggested-by: Leo Liu <<a href="mailto:leo.liu@amd.com" target="_blank">leo.liu@amd.com</a>><br>>>>>>>>>>>> Signed-off-by: Nayan Deshmukh <<a href="mailto:nayan26deshmukh@gmail.com" target="_blank">nayan26deshmukh@gmail.com</a>><br>>>>>>>>>>><br>>>>>>>>>>><br>>>>>>>>>>><br>>>>>>>>>>> Acked-by: Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>>.<br>>>>>>>>>>><br>>>>>>>>>>> Andy & Leo did you guys already had a chance to test it? To me it<br>>>>>>>>>>> looks<br>>>>>>>>>>> like this should work now.<br>>>>>>>>>><br>>>>>>>>>><br>>>>>>>>>><br>>>>>>>>>> Well there is still the tearing issue from loosing pageflips.<br>>>>>>>>>><br>>>>>>>>>> Maybe different GPUs don't see this. I can fix by forcing perf but<br>>>>>>>>>> I<br>>>>>>>>>> just tested dal and it's not even fixable running that.<br>>>>>>>>>><br>>>>>>>>>> I guess that may not count as an issue with these patches as such<br>>>>>>>>>> if<br>>>>>>>>>> xorg/xf86-video-amdgpu can work around, but it's a very noticeable<br>>>>>>>>>> regression until that happens.<br>>>>>>>>><br>>>>>>>>><br>>>>>>>>><br>>>>>>>>> Somebody should track down why the buffers sent for presentation in<br>>>>>>>>> this<br>>>>>>>>> case don't use the same tiling parameters as buffers used for GL via<br>>>>>>>>> DRI3.<br>>>>>>>>><br>>>>>>>> I can look into this, but I don't know where to look exactly. Can you<br>>>>>>>> give some<br>>>>>>>> pointers to get started.<br>>>>>>><br>>>>>>><br>>>>>>><br>>>>>>> Looking at src/gallium/auxiliary/vl/vl_<wbr>winsys_dri3.c and the patches<br>>>>>>> again, my guess is that it's due to PIPE_BIND_SCANOUT not being set<br>>>>>>> when<br>>>>>>> creating the buffers that are now being directly sent to the X server<br>>>>>>> for presentation.<br>>>>>>><br>>>>>> So the only way to avoid this is to have a PIPE_BIND_SCANOUT for the<br>>>>>> output surfaces of the state tracker. Will introducing<br>>>>>> PIPE_BIND_SCANOUT lead to performance loss for these surfaces?<br>>>>><br>>>>><br>>>>><br>>>>> Potentially, but I doubt it'll make a big difference for this use case.<br>>>>> In the future, there might be a feedback mechanism which allows<br>>>>> re-allocating the buffer with/out PIPE_BIND_SCANOUT according to the<br>>>>> current circumstances, but for now it's probably better to set it (at<br>>>>> least in cases where we don't know that the buffer can never be scanned<br>>>>> out directly) to allow for page flipping.<br>>>><br>>>><br>>>><br>>>> Pure luck noticing this because I haven't tested modesetting driver for<br>>>> ages, but -<br>>>><br>>>> These patches also break full screen vdpau playback when using that.<br>>>><br>>>> Result is a screen of mostly junk with a hint of the vid - looks like<br>>>> when direct scan out fails on wayland due to tiling mismatch.<br>>>><br>>><br>><br><br></div></div>