Skip to content
  • Daniel Stone's avatar
    compositor-drm: Don't set fb->size for non-dumb buffers · bdebc317
    Daniel Stone authored
    
    
    When creating a drm_fb from client (wl_buffer/dmabuf), gbm_surface, or
    client buffers, set fb->size to 0. The size member is only used for dumb
    buffers, where we mmap the whole buffer, and need the size recorded to
    later pass to munmap.
    
    Determining the full size of multi-planar buffers is difficult, as
    auxiliary planes are not guaranteed to have a (height*stride)
    allocation, e.g. if they are subsampled or if they do not contain pixel
    data at all but, e.g., compression information. Single-plane tiled
    buffers also often pad the buffer allocation to a multiple of tile
    height, making our existing calculation incorrect.
    
    Though it does no harm to record incorrect information, it also does
    no good as we never use it; remove it in order to avoid any confusion.
    
    Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    bdebc317