drm/tegra: Use fourcc_mod_is_vendor() helper
authorThierry Reding <treding@nvidia.com>
Thu, 10 Jun 2021 11:12:36 +0000 (13:12 +0200)
committerThierry Reding <treding@nvidia.com>
Mon, 16 Aug 2021 10:19:21 +0000 (12:19 +0200)
Rather than open-coding the vendor extraction operation, use the newly
introduced helper macro.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210610111236.3814211-3-thierry.reding@gmail.com
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/tegra/plane.c

index cae8b8c..c04dda8 100644 (file)
@@ -44,7 +44,7 @@ int tegra_fb_get_tiling(struct drm_framebuffer *framebuffer,
 {
        uint64_t modifier = framebuffer->modifier;
 
-       if ((modifier >> 56) == DRM_FORMAT_MOD_VENDOR_NVIDIA) {
+       if (fourcc_mod_is_vendor(modifier, NVIDIA)) {
                if ((modifier & DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT) == 0)
                        tiling->sector_layout = TEGRA_BO_SECTOR_LAYOUT_TEGRA;
                else
index 2e65b40..f749642 100644 (file)
@@ -109,7 +109,7 @@ static bool tegra_plane_format_mod_supported(struct drm_plane *plane,
                return true;
 
        /* check for the sector layout bit */
-       if ((modifier >> 56) == DRM_FORMAT_MOD_VENDOR_NVIDIA) {
+       if (fourcc_mod_is_vendor(modifier, NVIDIA)) {
                if (modifier & DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT) {
                        if (!tegra_plane_supports_sector_layout(plane))
                                return false;