diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-05-19 06:54:10 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-06-01 13:07:12 -0400 |
commit | b0e08823ca5345a5e4188d3abced1dc2565cc66c (patch) | |
tree | a92d50692407f3d8d1a1e9f695c0c101e78093d7 | |
parent | 72d465aabccfc0ab8d27858b9d83967313bf02a9 (diff) |
drm/exynos/fimc: simplify and rename fimc_dst_get_buf_seq
fimc_dst_get_buf_seq returns number of buffers
so the name should be fimc_dst_get_buf_count.
Function body has been simplified.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimc.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 9860d38df6fc..831dde9034c6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -58,7 +58,6 @@ | |||
58 | #define FIMC_SHFACTOR 10 | 58 | #define FIMC_SHFACTOR 10 |
59 | #define FIMC_BUF_STOP 1 | 59 | #define FIMC_BUF_STOP 1 |
60 | #define FIMC_BUF_START 2 | 60 | #define FIMC_BUF_START 2 |
61 | #define FIMC_REG_SZ 32 | ||
62 | #define FIMC_WIDTH_ITU_709 1280 | 61 | #define FIMC_WIDTH_ITU_709 1280 |
63 | #define FIMC_REFRESH_MAX 60 | 62 | #define FIMC_REFRESH_MAX 60 |
64 | #define FIMC_REFRESH_MIN 12 | 63 | #define FIMC_REFRESH_MIN 12 |
@@ -1123,16 +1122,13 @@ static int fimc_dst_set_size(struct device *dev, int swap, | |||
1123 | return 0; | 1122 | return 0; |
1124 | } | 1123 | } |
1125 | 1124 | ||
1126 | static int fimc_dst_get_buf_seq(struct fimc_context *ctx) | 1125 | static int fimc_dst_get_buf_count(struct fimc_context *ctx) |
1127 | { | 1126 | { |
1128 | u32 cfg, i, buf_num = 0; | 1127 | u32 cfg, buf_num; |
1129 | u32 mask = 0x00000001; | ||
1130 | 1128 | ||
1131 | cfg = fimc_read(ctx, EXYNOS_CIFCNTSEQ); | 1129 | cfg = fimc_read(ctx, EXYNOS_CIFCNTSEQ); |
1132 | 1130 | ||
1133 | for (i = 0; i < FIMC_REG_SZ; i++) | 1131 | buf_num = hweight32(cfg); |
1134 | if (cfg & (mask << i)) | ||
1135 | buf_num++; | ||
1136 | 1132 | ||
1137 | DRM_DEBUG_KMS("buf_num[%d]\n", buf_num); | 1133 | DRM_DEBUG_KMS("buf_num[%d]\n", buf_num); |
1138 | 1134 | ||
@@ -1176,12 +1172,12 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, | |||
1176 | 1172 | ||
1177 | /* interrupt enable */ | 1173 | /* interrupt enable */ |
1178 | if (buf_type == IPP_BUF_ENQUEUE && | 1174 | if (buf_type == IPP_BUF_ENQUEUE && |
1179 | fimc_dst_get_buf_seq(ctx) >= FIMC_BUF_START) | 1175 | fimc_dst_get_buf_count(ctx) >= FIMC_BUF_START) |
1180 | fimc_mask_irq(ctx, true); | 1176 | fimc_mask_irq(ctx, true); |
1181 | 1177 | ||
1182 | /* interrupt disable */ | 1178 | /* interrupt disable */ |
1183 | if (buf_type == IPP_BUF_DEQUEUE && | 1179 | if (buf_type == IPP_BUF_DEQUEUE && |
1184 | fimc_dst_get_buf_seq(ctx) <= FIMC_BUF_STOP) | 1180 | fimc_dst_get_buf_count(ctx) <= FIMC_BUF_STOP) |
1185 | fimc_mask_irq(ctx, false); | 1181 | fimc_mask_irq(ctx, false); |
1186 | 1182 | ||
1187 | err_unlock: | 1183 | err_unlock: |