[Mesa-stable] [Mesa-dev] [PATCH] gbm/dri: Flush after unmap

Emil Velikov emil.l.velikov at gmail.com
Thu Mar 30 13:23:29 UTC 2017


On 29 March 2017 at 13:34, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 29 March 2017 at 13:02, Thomas Hellstrom <thellstrom at vmware.com> wrote:
>> Hi, Emil,
>>
>> On 03/29/2017 01:30 PM, Emil Velikov wrote:
>>> Hi Thomas,
>>>
>>> On 28 March 2017 at 20:39, Thomas Hellstrom <thellstrom at vmware.com> wrote:
>>>> Drivers may queue dma operations on the context at unmap time so we need
>>>> to flush to make sure the data gets to the bo. Ideally the application
>>>> would take care of this, but since there appears to be no exported gbm
>>>> flush functionality we need to explicitly flush at unmap time.
>>>>
>>>> This fixes a problem where kmscube on vmwgfx in rgba textured mode would
>>>> render using an uninitialized texture rather than the intended
>>>> rgba pattern.
>>>>
>>> I haven't checked but the issue should not be restricted to vmwgfx, right ?
>>>
>>> Perhaps we should add the following
>>> Fixes: 8aeb6d768b4 ("gbm: Add map/unmap functions")
>>> CC: <mesa-stable at lists.freedesktop.org>
>>
>> Unfortunately I've, perhaps a bit prematurely, already pushed the fix.
>> Is there a way to get it
>> into stable after push?
>>
> Adding mesa-stable@ to the CC list should do it. Check out the
> instructions for more examples.
>
> https://www.mesa3d.org/submittingpatches.html#nominations
>
>>
>>>
>>>> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
>>>> ---
>>>>  src/gbm/backends/dri/gbm_dri.c | 9 ++++++++-
>>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
>>>> index ac7ede8..6c2244c 100644
>>>> --- a/src/gbm/backends/dri/gbm_dri.c
>>>> +++ b/src/gbm/backends/dri/gbm_dri.c
>>>> @@ -243,7 +243,7 @@ struct dri_extension_match {
>>>>  };
>>>>
>>>>  static struct dri_extension_match dri_core_extensions[] = {
>>>> -   { __DRI2_FLUSH, 1, offsetof(struct gbm_dri_device, flush) },
>>>> +   { __DRI2_FLUSH, 4, offsetof(struct gbm_dri_device, flush) },
>>> Currently the classic nouveau, radeon/r200 and i915 drivers do not
>>> support v4 of the extension.
>>> As-is this will 'break' them... if they ever worked to begin with.
>>>
>>> One solution is to bail out (return -ENOSYS or similar) in map/unmap
>>> API of the when the DRI module is too old.
>>> Just some ^^ food for thought.
>>
>> Hmm. Is there even a use-case for gbm with those drivers? If so we
>> should perhaps make them up-to-date with the flush extension.
>>
> Of the above:
>
> - nouveau: Does not support DRI_IMAGE, thus it doesn't work even
> before the patch.
> - i915: I have some untested ancient patches. Will see if I can rebase
> + send out.
It seems that the Intel CI regressed since it is also testing i915.

I'll try to respin my patches later on today/tomorrow.

In the meanwhile: Thomas, can you fix this patch to use v4 only in
gbm_map/unmap ?

Thanks
Emil


More information about the mesa-stable mailing list