drm: Replace drm_framebuffer plane size functions with its equivalents
authorCarlos Eduardo Gallo Filho <gcarlos@disroot.org>
Tue, 26 Sep 2023 14:15:19 +0000 (11:15 -0300)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 12 Oct 2023 07:51:29 +0000 (09:51 +0200)
commit451921e7bbc74fd87bfc9b413e4d57cc498fcca8
treef47ca2bded9739e2a36652c92bf148c7ab36f72a
parentf2f455981a34ce8ca88a41458c09494b387d344f
drm: Replace drm_framebuffer plane size functions with its equivalents

The functions drm_framebuffer_plane_{width,height} and
fb_plane_{width,height} do exactly the same job of its
equivalents drm_format_info_plane_{width,height} from drm_fourcc.

The only reason to have these functions on drm_framebuffer
would be if they would added a abstraction layer to call it just
passing a drm_framebuffer pointer and the desired plane index,
which is not the case, where these functions actually implements
just part of it. In the actual implementation, every call to both
drm_framebuffer_plane_{width,height} and fb_plane_{width,height} should
pass some drm_framebuffer attribute, which is the same as calling the
drm_format_info_plane_{width,height} functions.

The drm_format_info_pane_{width,height} functions are much more
consistent in both its implementation and its location on code. The
kind of calculation that they do is intrinsically derivated from the
drm_format_info struct and has not to do with drm_framebuffer, except
by the potential motivation described above, which is still not a good
justification to have drm_framebuffer functions to calculate it.

So, replace each drm_framebuffer_plane_{width,height} and
fb_plane_{width,height} call to drm_format_info_plane_{width,height}
and remove them.

Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230926141519.9315-3-gcarlos@disroot.org
drivers/gpu/drm/drm_framebuffer.c
drivers/gpu/drm/i915/display/intel_fb.c
include/drm/drm_framebuffer.h