[Mesa-dev] [PATCH 14/34] gbm: Get modifiers from DRI

Daniel Stone daniel at fooishbar.org
Mon Feb 6 19:47:16 UTC 2017


Hi,

On 6 February 2017 at 19:22, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Sun, Feb 5, 2017 at 1:15 PM, Ben Widawsky <ben at bwidawsk.net> wrote:
>> Introducing the LINEAR modifier (which happened after v2 of this series) did
>> make things complex because it's possible in some horrific future that a image
>> doesn't support linear. As a result, you are correct. I think for this case, the
>> client can handle it pretty easily, and returning INVALID is the right
>> thing to do.
>>
>> Daniel, are you okay with changing this to return DRM_FORMAT_MOD_INVALID?

Hm, it's a little less clean, but sure, works for me.

>> Yeah, this is also a lie but way trickier than the above. Again before this rev
>> of the series, 0 meant DRM_FORMAT_MOD_NONE, and that was actually legit,
>> however, now it does mean LINEAR. I believe it's safe to assume that all dumb
>> BOs are linear, but it should probably be baked in somewhere better. One option
>> would be to create a proper DRIimage for a dumb BO, but I think the best bet is
>> to just replace 0 with DRM_FORMAT_MOD_LINEAR.
>
> That sounds fairly reasonable to me.  I guess someone could create a BO with
> GBM and then call the kernel ioctl to set the tiling mode to X-tiled and
> then ask what it has.  However, short of calling into the driver and having
> it query the kernel, I don't see a good way to get around that.  I think I'd
> be ok with just returning LINEAR and saying "don't do that".  Daniel?

That's impressively contrived, which is a polite way of saying deeply
stupid; wouldn't that break Mesa anyway? I'm happy to ban that.

Cheers,
Daniel


More information about the mesa-dev mailing list