diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2013-10-09 13:59:43 +0200 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:44:55 +0900 |
commit | a235371c533f6f8ef8f87f292218838045f61e37 (patch) | |
tree | 82325ad095386dde3642e910aca30d6ad7c2d33d /drivers/gpu/drm/exynos/exynos_drm_fimc.c | |
parent | a325dad20d3102f2dde1e2df878a49b04e1485cc (diff) | |
download | linux-3.10-a235371c533f6f8ef8f87f292218838045f61e37.tar.gz linux-3.10-a235371c533f6f8ef8f87f292218838045f61e37.tar.bz2 linux-3.10-a235371c533f6f8ef8f87f292218838045f61e37.zip |
exynos_drm_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>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fimc.c')
-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 d6e7bf4033d..ee8c8211d66 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -58,7 +58,6 @@ #define FIMC_SHFACTOR 10 #define FIMC_BUF_STOP 1 #define FIMC_BUF_START 2 -#define FIMC_REG_SZ 32 #define FIMC_WIDTH_ITU_709 1280 #define FIMC_REFRESH_MAX 60 #define FIMC_REFRESH_MIN 12 @@ -1128,16 +1127,13 @@ static int fimc_dst_set_size(struct device *dev, int swap, return 0; } -static int fimc_dst_get_buf_seq(struct fimc_context *ctx) +static int fimc_dst_get_buf_count(struct fimc_context *ctx) { - u32 cfg, i, buf_num = 0; - u32 mask = 0x00000001; + u32 cfg, buf_num; cfg = fimc_read(ctx, EXYNOS_CIFCNTSEQ); - for (i = 0; i < FIMC_REG_SZ; i++) - if (cfg & (mask << i)) - buf_num++; + buf_num = hweight32(cfg); DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num); @@ -1182,12 +1178,12 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, /* interrupt enable */ if (buf_type == IPP_BUF_ENQUEUE && - fimc_dst_get_buf_seq(ctx) >= FIMC_BUF_START) + fimc_dst_get_buf_count(ctx) >= FIMC_BUF_START) fimc_mask_irq(ctx, true, false, true); /* interrupt disable */ if (buf_type == IPP_BUF_DEQUEUE && - fimc_dst_get_buf_seq(ctx) <= FIMC_BUF_STOP) + fimc_dst_get_buf_count(ctx) <= FIMC_BUF_STOP) fimc_mask_irq(ctx, false, false, true); err_unlock: |