diff mbox series

[3/3] drm/tegra: Use fourcc_mod_is_vendor() helper

Message ID 20210610111236.3814211-3-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/fourcc: Add macros to determine the modifier vendor | expand

Commit Message

Thierry Reding June 10, 2021, 11:12 a.m. UTC
From: Thierry Reding <treding@nvidia.com>

Rather than open-coding the vendor extraction operation, use the newly
introduced helper macro.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/tegra/fb.c    | 2 +-
 drivers/gpu/drm/tegra/plane.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter June 10, 2021, 5:37 p.m. UTC | #1
On Thu, Jun 10, 2021 at 01:12:36PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Rather than open-coding the vendor extraction operation, use the newly
> introduced helper macro.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/tegra/fb.c    | 2 +-
>  drivers/gpu/drm/tegra/plane.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
> index cae8b8cbe9dd..c04dda8353fd 100644
> --- a/drivers/gpu/drm/tegra/fb.c
> +++ b/drivers/gpu/drm/tegra/fb.c
> @@ -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
> diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
> index 2e65b4075ce6..f7496425fa83 100644
> --- a/drivers/gpu/drm/tegra/plane.c
> +++ b/drivers/gpu/drm/tegra/plane.c
> @@ -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;
> -- 
> 2.31.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index cae8b8cbe9dd..c04dda8353fd 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -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
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index 2e65b4075ce6..f7496425fa83 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -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;