• Thomas Zimmermann's avatar
    fbdev: Use pageref offset for deferred-I/O writeback · e2d8b428
    Thomas Zimmermann authored
    Use pageref->offset instead of page->index for deferred-I/O writeback
    where appropriate. Distinguishes between file-mapping offset and video-
    memory offset. While at it, also remove unnecessary references to
    struct page.
    
    Fbdev's deferred-I/O code uses the two related page->index and
    pageref->offset. The former is the page offset in the mapped file,
    the latter is the byte offset in the video memory (or fbdev screen
    buffer). It's the same value for fbdev drivers, but for DRM the values
    can be different. Because GEM buffer objects are mapped at an offset
    in the DRM device file, page->index has this offset added to it as well.
    We currently don't hit this case in DRM, because all affected mappings
    of GEM memory are performed with an internal, intermediate shadow buffer.
    
    The value of page->index is required by page_mkclean(), which we
    call to reset the mappings during the writeback phase of the deferred
    I/O. The value of pageref->offset is for conveniently getting an offset
    into video memory in fb helpers.
    
    v4:
    	* fix commit message (Javier)
    Suggested-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
    Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
    Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-6-tzimmermann@suse.de
    e2d8b428
smscufx.c 53.1 KB