diff options
author | Ayan Kumar Halder <ayan.halder@arm.com> | 2018-07-17 13:13:45 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-10-02 02:36:56 -0400 |
commit | e58febe1d99c6557bc7a4397426e9d470cc7f430 (patch) | |
tree | 831b5ac0b944ef35fb1a90c0b3d8543758e69097 | |
parent | f5b9930b85dc6319fd6bcc259e447eff62fc691c (diff) |
drm/omap: Substitute format_is_yuv() with format->is_yuv
drm_format_info table has a field 'is_yuv' to denote if the format
is yuv or not. The driver is expected to use this instead of
having a function for the same purpose.
Signed-off-by: Ayan Kumar halder <ayan.halder@arm.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dispc.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 7c23f23137e9..ba82d916719c 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c | |||
@@ -1140,18 +1140,6 @@ static void dispc_ovl_set_color_mode(struct dispc_device *dispc, | |||
1140 | REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES(plane), m, 4, 1); | 1140 | REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES(plane), m, 4, 1); |
1141 | } | 1141 | } |
1142 | 1142 | ||
1143 | static bool format_is_yuv(u32 fourcc) | ||
1144 | { | ||
1145 | switch (fourcc) { | ||
1146 | case DRM_FORMAT_YUYV: | ||
1147 | case DRM_FORMAT_UYVY: | ||
1148 | case DRM_FORMAT_NV12: | ||
1149 | return true; | ||
1150 | default: | ||
1151 | return false; | ||
1152 | } | ||
1153 | } | ||
1154 | |||
1155 | static void dispc_ovl_configure_burst_type(struct dispc_device *dispc, | 1143 | static void dispc_ovl_configure_burst_type(struct dispc_device *dispc, |
1156 | enum omap_plane_id plane, | 1144 | enum omap_plane_id plane, |
1157 | enum omap_dss_rotation_type rotation) | 1145 | enum omap_dss_rotation_type rotation) |
@@ -1910,11 +1898,14 @@ static void dispc_ovl_set_scaling_uv(struct dispc_device *dispc, | |||
1910 | int scale_x = out_width != orig_width; | 1898 | int scale_x = out_width != orig_width; |
1911 | int scale_y = out_height != orig_height; | 1899 | int scale_y = out_height != orig_height; |
1912 | bool chroma_upscale = plane != OMAP_DSS_WB; | 1900 | bool chroma_upscale = plane != OMAP_DSS_WB; |
1901 | const struct drm_format_info *info; | ||
1902 | |||
1903 | info = drm_format_info(fourcc); | ||
1913 | 1904 | ||
1914 | if (!dispc_has_feature(dispc, FEAT_HANDLE_UV_SEPARATE)) | 1905 | if (!dispc_has_feature(dispc, FEAT_HANDLE_UV_SEPARATE)) |
1915 | return; | 1906 | return; |
1916 | 1907 | ||
1917 | if (!format_is_yuv(fourcc)) { | 1908 | if (!info->is_yuv) { |
1918 | /* reset chroma resampling for RGB formats */ | 1909 | /* reset chroma resampling for RGB formats */ |
1919 | if (plane != OMAP_DSS_WB) | 1910 | if (plane != OMAP_DSS_WB) |
1920 | REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), | 1911 | REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), |
@@ -2632,6 +2623,9 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, | |||
2632 | bool ilace = !!(vm->flags & DISPLAY_FLAGS_INTERLACED); | 2623 | bool ilace = !!(vm->flags & DISPLAY_FLAGS_INTERLACED); |
2633 | unsigned long pclk = dispc_plane_pclk_rate(dispc, plane); | 2624 | unsigned long pclk = dispc_plane_pclk_rate(dispc, plane); |
2634 | unsigned long lclk = dispc_plane_lclk_rate(dispc, plane); | 2625 | unsigned long lclk = dispc_plane_lclk_rate(dispc, plane); |
2626 | const struct drm_format_info *info; | ||
2627 | |||
2628 | info = drm_format_info(fourcc); | ||
2635 | 2629 | ||
2636 | /* when setting up WB, dispc_plane_pclk_rate() returns 0 */ | 2630 | /* when setting up WB, dispc_plane_pclk_rate() returns 0 */ |
2637 | if (plane == OMAP_DSS_WB) | 2631 | if (plane == OMAP_DSS_WB) |
@@ -2640,7 +2634,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, | |||
2640 | if (paddr == 0 && rotation_type != OMAP_DSS_ROT_TILER) | 2634 | if (paddr == 0 && rotation_type != OMAP_DSS_ROT_TILER) |
2641 | return -EINVAL; | 2635 | return -EINVAL; |
2642 | 2636 | ||
2643 | if (format_is_yuv(fourcc) && (in_width & 1)) { | 2637 | if (info->is_yuv && (in_width & 1)) { |
2644 | DSSERR("input width %d is not even for YUV format\n", in_width); | 2638 | DSSERR("input width %d is not even for YUV format\n", in_width); |
2645 | return -EINVAL; | 2639 | return -EINVAL; |
2646 | } | 2640 | } |
@@ -2680,7 +2674,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, | |||
2680 | DSSDBG("predecimation %d x %x, new input size %d x %d\n", | 2674 | DSSDBG("predecimation %d x %x, new input size %d x %d\n", |
2681 | x_predecim, y_predecim, in_width, in_height); | 2675 | x_predecim, y_predecim, in_width, in_height); |
2682 | 2676 | ||
2683 | if (format_is_yuv(fourcc) && (in_width & 1)) { | 2677 | if (info->is_yuv && (in_width & 1)) { |
2684 | DSSDBG("predecimated input width is not even for YUV format\n"); | 2678 | DSSDBG("predecimated input width is not even for YUV format\n"); |
2685 | DSSDBG("adjusting input width %d -> %d\n", | 2679 | DSSDBG("adjusting input width %d -> %d\n", |
2686 | in_width, in_width & ~1); | 2680 | in_width, in_width & ~1); |
@@ -2688,7 +2682,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, | |||
2688 | in_width &= ~1; | 2682 | in_width &= ~1; |
2689 | } | 2683 | } |
2690 | 2684 | ||
2691 | if (format_is_yuv(fourcc)) | 2685 | if (info->is_yuv) |
2692 | cconv = 1; | 2686 | cconv = 1; |
2693 | 2687 | ||
2694 | if (ilace && !fieldmode) { | 2688 | if (ilace && !fieldmode) { |