[Mesa-dev] [PATCH] vulkan/wsi: Only use LINEAR modifier for prime if supported.
Jason Ekstrand
jason at jlekstrand.net
Sun May 6 14:02:49 UTC 2018
On May 6, 2018 05:58:52 Daniel Stone <daniel at fooishbar.org> wrote:
> Hi,
>
> On 5 May 2018 at 19:07, Jason Ekstrand <jason at jlekstrand.net> wrote:
>> On Sat, May 5, 2018 at 6:34 AM, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
>> wrote:
>>> @@ -1043,7 +1043,8 @@ x11_image_init(VkDevice device_h, struct
>>> x11_swapchain *chain,
>>> uint32_t bpp = 32;
>>>
>>> if (chain->base.use_prime_blit) {
>>> - result = wsi_create_prime_image(&chain->base, pCreateInfo,
>>> &image->base);
>>> + bool use_modifier = num_tranches > 0;
>>> + result = wsi_create_prime_image(&chain->base, pCreateInfo,
>>> use_modifier, &image->base);
>>
>> This confused me for a bit but I think I see what's going on. You have an X
>> server which doesn't know about modifiers but mesa is built with modifier
>> support and prime is in use. This results in the WSI code calling
>> dri3_pixmap_from_buffers (plural) on an X server which doesn't support it.
>>
>> I'm not sure what I think about this way of solving the problem. In my
>> twisted mind, DRM_FORMAT_MOD_LINEAR should always be valid even if the
>> modifier is ultimately ignored. I'm going to send a counter-patch which
>> solves it another way but I'm not sure if my solution is better. Daniel, do
>> you have any thoughts?
>
> Linear is fairly unique in aliasing a pre-modifier GBM use flag, as
> well as something that translates well across all our drivers. That
> being said, I prefer Bas's patch for consistency: currently, we
> _always_ set INVALID _everywhere_ if one or more components in the
> chain are not modifier-aware. I don't really see a reason to diverge
> here, especially when we could end up deciding on LINEAR inside the
> driver but still setting INVALID for other reasons, e.g. if the user
> requests a linear VkTilingMode.
Fair enough.
More information about the mesa-dev
mailing list