Re: [PATCH 02/23] drm: omapdrm: fb: Don't store format BPP for each plane

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/05/16 23:57, Laurent Pinchart wrote:

>> fwiw, I guess a lot of data from that table could these days be
>> replaced w/ some of the drm format helpers
>> (drm_format_num_planes()/drm_format_plane_cpp()/drm_format_{horz,vert}_chrom
>> a_subsampling()/etc)
> 
> I don't like those helpers as they're inefficient. Drivers often need to know 
> multiple pieces of information about a format, and the API forces look-ups for 
> every piece of information needed.
> 
> Would it make sense to add a drm_format_info() function that returns a pointer 
> to a data structure that describes the format, and reimplement the existing 
> helpers on top of that ?

I do like that idea.

A table implementation might possibly be faster even with the current
API. Those big switch-cases compile into a big pile of
if-else-if-else-ifs, whereas a for loop would compile into just a few
instructions. But just guessing here =).

In theory, the table could be sorted, making the lookup much faster, but
I'm not sure if that's worth the effort.

 Tomi

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux