Using bitmap for the flags results in a clumsy syntax on test_bit,
replace it with unsigned long type and simple binary ops.

Signed-off-by: Dmitry Baryshkov <dmitry.barysh...@linaro.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 18 +++++++++---------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 16 +++++++---------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
index 05e82f5dd0e6..3112d85808c7 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
@@ -45,7 +45,7 @@ bp, flg, fm, np)                                              
            \
        .unpack_count = uc,                                               \
        .bpp = bp,                                                        \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = DPU_TILE_HEIGHT_DEFAULT                            \
 }
@@ -64,7 +64,7 @@ alpha, bp, flg, fm, np, th)                                   
            \
        .unpack_count = uc,                                               \
        .bpp = bp,                                                        \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = th                                                 \
 }
@@ -84,7 +84,7 @@ alpha, chroma, count, bp, flg, fm, np)                        
            \
        .unpack_count = count,                                            \
        .bpp = bp,                                                        \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = DPU_TILE_HEIGHT_DEFAULT                            \
 }
@@ -102,7 +102,7 @@ alpha, chroma, count, bp, flg, fm, np)                      
              \
        .unpack_count = 2,                                                \
        .bpp = 2,                                                         \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = DPU_TILE_HEIGHT_DEFAULT                            \
 }
@@ -121,7 +121,7 @@ flg, fm, np, th)                                            
              \
        .unpack_count = 2,                                                \
        .bpp = 2,                                                         \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = th                                                 \
 }
@@ -139,7 +139,7 @@ flg, fm, np, th)                                            
              \
        .unpack_count = 2,                                                \
        .bpp = 2,                                                         \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = DPU_TILE_HEIGHT_DEFAULT                            \
 }
@@ -158,7 +158,7 @@ flg, fm, np, th)                                            
              \
        .unpack_count = 2,                                                \
        .bpp = 2,                                                         \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = th                                                 \
 }
@@ -178,7 +178,7 @@ flg, fm, np)                                                
      \
        .unpack_count = 1,                                                \
        .bpp = bp,                                                        \
        .fetch_mode = fm,                                                 \
-       .flag = {(flg)},                                                  \
+       .flags = flg,                                                     \
        .num_planes = np,                                                 \
        .tile_height = DPU_TILE_HEIGHT_DEFAULT                            \
 }
@@ -1047,7 +1047,7 @@ const struct dpu_format *dpu_get_dpu_format_ext(
                DPU_ERROR("unsupported fmt: %4.4s modifier 0x%llX\n",
                        (char *)&format, modifier);
        else
-               DRM_DEBUG_ATOMIC("fmt %4.4s mod 0x%llX ubwc %d yuv %d\n",
+               DRM_DEBUG_ATOMIC("fmt %4.4s mod 0x%llX ubwc %d yuv %ld\n",
                                (char *)&format, modifier,
                                DPU_FORMAT_IS_UBWC(fmt),
                                DPU_FORMAT_IS_YUV(fmt));
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h
index ebb3f9f493c3..caa0ff2d192f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h
@@ -40,23 +40,21 @@ enum dpu_format_flags {
        DPU_FORMAT_FLAG_YUV_BIT,
        DPU_FORMAT_FLAG_DX_BIT,
        DPU_FORMAT_FLAG_COMPRESSED_BIT,
-       DPU_FORMAT_FLAG_BIT_MAX,
 };
 
 #define DPU_FORMAT_FLAG_YUV            BIT(DPU_FORMAT_FLAG_YUV_BIT)
 #define DPU_FORMAT_FLAG_DX             BIT(DPU_FORMAT_FLAG_DX_BIT)
 #define DPU_FORMAT_FLAG_COMPRESSED     BIT(DPU_FORMAT_FLAG_COMPRESSED_BIT)
-#define DPU_FORMAT_IS_YUV(X)           \
-       (test_bit(DPU_FORMAT_FLAG_YUV_BIT, (X)->flag))
-#define DPU_FORMAT_IS_DX(X)            \
-       (test_bit(DPU_FORMAT_FLAG_DX_BIT, (X)->flag))
+
+#define DPU_FORMAT_IS_YUV(X)           ((X)->flags & DPU_FORMAT_FLAG_YUV)
+#define DPU_FORMAT_IS_DX(X)            ((X)->flags & DPU_FORMAT_FLAG_DX)
 #define DPU_FORMAT_IS_LINEAR(X)                ((X)->fetch_mode == 
MDP_FETCH_LINEAR)
 #define DPU_FORMAT_IS_TILE(X) \
        (((X)->fetch_mode == MDP_FETCH_UBWC) && \
-                       !test_bit(DPU_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
+        !((X)->flags & DPU_FORMAT_FLAG_COMPRESSED))
 #define DPU_FORMAT_IS_UBWC(X) \
        (((X)->fetch_mode == MDP_FETCH_UBWC) && \
-                       test_bit(DPU_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
+        ((X)->flags & DPU_FORMAT_FLAG_COMPRESSED))
 
 #define DPU_BLEND_FG_ALPHA_FG_CONST    (0 << 0)
 #define DPU_BLEND_FG_ALPHA_BG_CONST    (1 << 0)
@@ -325,7 +323,7 @@ enum dpu_3d_blend_mode {
  * @alpha_enable: whether the format has an alpha channel
  * @num_planes: number of planes (including meta data planes)
  * @fetch_mode: linear, tiled, or ubwc hw fetch behavior
- * @flag: usage bit flags
+ * @flags: usage bit flags
  * @tile_width: format tile width
  * @tile_height: format tile height
  */
@@ -342,7 +340,7 @@ struct dpu_format {
        u8 alpha_enable;
        u8 num_planes;
        enum mdp_fetch_mode fetch_mode;
-       DECLARE_BITMAP(flag, DPU_FORMAT_FLAG_BIT_MAX);
+       unsigned long flags;
        u16 tile_width;
        u16 tile_height;
 };
-- 
2.39.2

Reply via email to