* [PATCH 0/7] gpu: ipu-v3: Remove unused functions
@ 2024-12-26 2:27 linux
2024-12-26 2:27 ` [PATCH 1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init linux
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Hi,
This set removes a bunch of functions in ipu-v3 that
have been unused for a long time (since 2012-2017).
No changes to functions are made, just full deletions.
Build tested only.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Dr. David Alan Gilbert (7):
gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init
gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees
gpu: ipu-v3: Remove unused ipu_idmac_channel_busy
gpu: ipu-v3: Remove unused ipu_image_convert_* functions
gpu: ipu-v3: Remove unused ipu_vdi_unsetup
gpu: ipu-v3: ipu-csi: Remove unused functions
gpu: ipu-v3 ipu-cpmem: Remove unused functions
drivers/gpu/ipu-v3/ipu-common.c | 38 ---------
drivers/gpu/ipu-v3/ipu-cpmem.c | 23 ------
drivers/gpu/ipu-v3/ipu-csi.c | 108 -------------------------
drivers/gpu/ipu-v3/ipu-ic.c | 73 -----------------
drivers/gpu/ipu-v3/ipu-image-convert.c | 48 -----------
drivers/gpu/ipu-v3/ipu-prv.h | 2 -
drivers/gpu/ipu-v3/ipu-vdi.c | 11 ---
include/video/imx-ipu-image-convert.h | 32 --------
include/video/imx-ipu-v3.h | 14 ----
9 files changed, 349 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
@ 2024-12-26 2:27 ` linux
2024-12-26 2:27 ` [PATCH 2/7] gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees linux
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
ipu_ic_task_graphics_init() was added in 2014 by
commit 1aa8ea0d2bd5 ("gpu: ipu-v3: Add Image Converter unit")
but has been unused.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-ic.c | 73 -------------------------------------
include/video/imx-ipu-v3.h | 4 --
2 files changed, 77 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-ic.c b/drivers/gpu/ipu-v3/ipu-ic.c
index 846461bac70d..acd76ecc5221 100644
--- a/drivers/gpu/ipu-v3/ipu-ic.c
+++ b/drivers/gpu/ipu-v3/ipu-ic.c
@@ -321,79 +321,6 @@ void ipu_ic_task_disable(struct ipu_ic *ic)
}
EXPORT_SYMBOL_GPL(ipu_ic_task_disable);
-int ipu_ic_task_graphics_init(struct ipu_ic *ic,
- const struct ipu_ic_colorspace *g_in_cs,
- bool galpha_en, u32 galpha,
- bool colorkey_en, u32 colorkey)
-{
- struct ipu_ic_priv *priv = ic->priv;
- struct ipu_ic_csc csc2;
- unsigned long flags;
- u32 reg, ic_conf;
- int ret = 0;
-
- if (ic->task == IC_TASK_ENCODER)
- return -EINVAL;
-
- spin_lock_irqsave(&priv->lock, flags);
-
- ic_conf = ipu_ic_read(ic, IC_CONF);
-
- if (!(ic_conf & ic->bit->ic_conf_csc1_en)) {
- struct ipu_ic_csc csc1;
-
- ret = ipu_ic_calc_csc(&csc1,
- V4L2_YCBCR_ENC_601,
- V4L2_QUANTIZATION_FULL_RANGE,
- IPUV3_COLORSPACE_RGB,
- V4L2_YCBCR_ENC_601,
- V4L2_QUANTIZATION_FULL_RANGE,
- IPUV3_COLORSPACE_RGB);
- if (ret)
- goto unlock;
-
- /* need transparent CSC1 conversion */
- ret = init_csc(ic, &csc1, 0);
- if (ret)
- goto unlock;
- }
-
- ic->g_in_cs = *g_in_cs;
- csc2.in_cs = ic->g_in_cs;
- csc2.out_cs = ic->out_cs;
-
- ret = __ipu_ic_calc_csc(&csc2);
- if (ret)
- goto unlock;
-
- ret = init_csc(ic, &csc2, 1);
- if (ret)
- goto unlock;
-
- if (galpha_en) {
- ic_conf |= IC_CONF_IC_GLB_LOC_A;
- reg = ipu_ic_read(ic, IC_CMBP_1);
- reg &= ~(0xff << ic->bit->ic_cmb_galpha_bit);
- reg |= (galpha << ic->bit->ic_cmb_galpha_bit);
- ipu_ic_write(ic, reg, IC_CMBP_1);
- } else
- ic_conf &= ~IC_CONF_IC_GLB_LOC_A;
-
- if (colorkey_en) {
- ic_conf |= IC_CONF_KEY_COLOR_EN;
- ipu_ic_write(ic, colorkey, IC_CMBP_2);
- } else
- ic_conf &= ~IC_CONF_KEY_COLOR_EN;
-
- ipu_ic_write(ic, ic_conf, IC_CONF);
-
- ic->graphics = true;
-unlock:
- spin_unlock_irqrestore(&priv->lock, flags);
- return ret;
-}
-EXPORT_SYMBOL_GPL(ipu_ic_task_graphics_init);
-
int ipu_ic_task_init_rsc(struct ipu_ic *ic,
const struct ipu_ic_csc *csc,
int in_width, int in_height,
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index c422a403c099..0bb1d714cbf5 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -445,10 +445,6 @@ int ipu_ic_task_init_rsc(struct ipu_ic *ic,
int in_width, int in_height,
int out_width, int out_height,
u32 rsc);
-int ipu_ic_task_graphics_init(struct ipu_ic *ic,
- const struct ipu_ic_colorspace *g_in_cs,
- bool galpha_en, u32 galpha,
- bool colorkey_en, u32 colorkey);
void ipu_ic_task_enable(struct ipu_ic *ic);
void ipu_ic_task_disable(struct ipu_ic *ic);
int ipu_ic_task_idma_init(struct ipu_ic *ic, struct ipuv3_channel *channel,
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/7] gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
2024-12-26 2:27 ` [PATCH 1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init linux
@ 2024-12-26 2:27 ` linux
2024-12-26 2:27 ` [PATCH 3/7] gpu: ipu-v3: Remove unused ipu_idmac_channel_busy linux
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
ipu_rot_mode_to_degrees() was added in 2014 by
commit f835f386a119 ("gpu: ipu-v3: Add rotation mode conversion utilities")
but has remained unused.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-common.c | 32 --------------------------------
include/video/imx-ipu-v3.h | 2 --
2 files changed, 34 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 947323f4a234..a8570e1bdf28 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -165,38 +165,6 @@ int ipu_degrees_to_rot_mode(enum ipu_rotate_mode *mode, int degrees,
}
EXPORT_SYMBOL_GPL(ipu_degrees_to_rot_mode);
-int ipu_rot_mode_to_degrees(int *degrees, enum ipu_rotate_mode mode,
- bool hflip, bool vflip)
-{
- u32 r90, vf, hf;
-
- r90 = ((u32)mode >> 2) & 0x1;
- hf = ((u32)mode >> 1) & 0x1;
- vf = ((u32)mode >> 0) & 0x1;
- hf ^= (u32)hflip;
- vf ^= (u32)vflip;
-
- switch ((enum ipu_rotate_mode)((r90 << 2) | (hf << 1) | vf)) {
- case IPU_ROTATE_NONE:
- *degrees = 0;
- break;
- case IPU_ROTATE_90_RIGHT:
- *degrees = 90;
- break;
- case IPU_ROTATE_180:
- *degrees = 180;
- break;
- case IPU_ROTATE_90_LEFT:
- *degrees = 270;
- break;
- default:
- return -EINVAL;
- }
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(ipu_rot_mode_to_degrees);
-
struct ipuv3_channel *ipu_idmac_get(struct ipu_soc *ipu, unsigned num)
{
struct ipuv3_channel *channel;
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 0bb1d714cbf5..8870f65c9a8b 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -484,8 +484,6 @@ enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc);
enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat);
int ipu_degrees_to_rot_mode(enum ipu_rotate_mode *mode, int degrees,
bool hflip, bool vflip);
-int ipu_rot_mode_to_degrees(int *degrees, enum ipu_rotate_mode mode,
- bool hflip, bool vflip);
struct ipu_client_platformdata {
int csi;
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/7] gpu: ipu-v3: Remove unused ipu_idmac_channel_busy
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
2024-12-26 2:27 ` [PATCH 1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init linux
2024-12-26 2:27 ` [PATCH 2/7] gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees linux
@ 2024-12-26 2:27 ` linux
2024-12-26 2:27 ` [PATCH 4/7] gpu: ipu-v3: Remove unused ipu_image_convert_* functions linux
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The last use of ipu_idmac_channel_busy() was removed in 2017 by
commit eb8c88808c83 ("drm/imx: add deferred plane disabling")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-common.c | 6 ------
drivers/gpu/ipu-v3/ipu-prv.h | 2 --
2 files changed, 8 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index a8570e1bdf28..fa77e4e64f12 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -484,12 +484,6 @@ int ipu_idmac_enable_channel(struct ipuv3_channel *channel)
}
EXPORT_SYMBOL_GPL(ipu_idmac_enable_channel);
-bool ipu_idmac_channel_busy(struct ipu_soc *ipu, unsigned int chno)
-{
- return (ipu_idmac_read(ipu, IDMAC_CHA_BUSY(chno)) & idma_mask(chno));
-}
-EXPORT_SYMBOL_GPL(ipu_idmac_channel_busy);
-
int ipu_idmac_wait_busy(struct ipuv3_channel *channel, int ms)
{
struct ipu_soc *ipu = channel->ipu;
diff --git a/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h
index 3884acb7995a..16322b2137f8 100644
--- a/drivers/gpu/ipu-v3/ipu-prv.h
+++ b/drivers/gpu/ipu-v3/ipu-prv.h
@@ -216,8 +216,6 @@ void ipu_srm_dp_update(struct ipu_soc *ipu, bool sync);
int ipu_module_enable(struct ipu_soc *ipu, u32 mask);
int ipu_module_disable(struct ipu_soc *ipu, u32 mask);
-bool ipu_idmac_channel_busy(struct ipu_soc *ipu, unsigned int chno);
-
int ipu_csi_init(struct ipu_soc *ipu, struct device *dev, int id,
unsigned long base, u32 module, struct clk *clk_ipu);
void ipu_csi_exit(struct ipu_soc *ipu, int id);
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/7] gpu: ipu-v3: Remove unused ipu_image_convert_* functions
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
` (2 preceding siblings ...)
2024-12-26 2:27 ` [PATCH 3/7] gpu: ipu-v3: Remove unused ipu_idmac_channel_busy linux
@ 2024-12-26 2:27 ` linux
2024-12-26 2:27 ` [PATCH 5/7] gpu: ipu-v3: Remove unused ipu_vdi_unsetup linux
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
ipu_image_convert_enum_format() and ipu_image_convert_sync() were both
added in 2016 by
commit cd98e85a6b78 ("gpu: ipu-v3: Add queued image conversion support")
but have remained unused.
Remove them.
ipu_image_convert_sync() was the last user of
image_convert_sync_complete().
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-image-convert.c | 48 --------------------------
include/video/imx-ipu-image-convert.h | 32 -----------------
2 files changed, 80 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index 841316582ea9..3c33b4defab5 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -355,20 +355,6 @@ static void dump_format(struct ipu_image_convert_ctx *ctx,
(ic_image->fmt->fourcc >> 24) & 0xff);
}
-int ipu_image_convert_enum_format(int index, u32 *fourcc)
-{
- const struct ipu_image_pixfmt *fmt;
-
- if (index >= (int)ARRAY_SIZE(image_convert_formats))
- return -EINVAL;
-
- /* Format found */
- fmt = &image_convert_formats[index];
- *fourcc = fmt->fourcc;
- return 0;
-}
-EXPORT_SYMBOL_GPL(ipu_image_convert_enum_format);
-
static void free_dma_buf(struct ipu_image_convert_priv *priv,
struct ipu_image_convert_dma_buf *buf)
{
@@ -2437,40 +2423,6 @@ ipu_image_convert(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
}
EXPORT_SYMBOL_GPL(ipu_image_convert);
-/* "Canned" synchronous single image conversion */
-static void image_convert_sync_complete(struct ipu_image_convert_run *run,
- void *data)
-{
- struct completion *comp = data;
-
- complete(comp);
-}
-
-int ipu_image_convert_sync(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
- struct ipu_image *in, struct ipu_image *out,
- enum ipu_rotate_mode rot_mode)
-{
- struct ipu_image_convert_run *run;
- struct completion comp;
- int ret;
-
- init_completion(&comp);
-
- run = ipu_image_convert(ipu, ic_task, in, out, rot_mode,
- image_convert_sync_complete, &comp);
- if (IS_ERR(run))
- return PTR_ERR(run);
-
- ret = wait_for_completion_timeout(&comp, msecs_to_jiffies(10000));
- ret = (ret == 0) ? -ETIMEDOUT : 0;
-
- ipu_image_convert_unprepare(run->ctx);
- kfree(run);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(ipu_image_convert_sync);
-
int ipu_image_convert_init(struct ipu_soc *ipu, struct device *dev)
{
struct ipu_image_convert_priv *priv;
diff --git a/include/video/imx-ipu-image-convert.h b/include/video/imx-ipu-image-convert.h
index 3c71b8b94b33..003b3927ede5 100644
--- a/include/video/imx-ipu-image-convert.h
+++ b/include/video/imx-ipu-image-convert.h
@@ -40,19 +40,6 @@ struct ipu_image_convert_run {
typedef void (*ipu_image_convert_cb_t)(struct ipu_image_convert_run *run,
void *ctx);
-/**
- * ipu_image_convert_enum_format() - enumerate the image converter's
- * supported input and output pixel formats.
- *
- * @index: pixel format index
- * @fourcc: v4l2 fourcc for this index
- *
- * Returns 0 with a valid index and fills in v4l2 fourcc, -EINVAL otherwise.
- *
- * In V4L2, drivers can call ipu_image_enum_format() in .enum_fmt.
- */
-int ipu_image_convert_enum_format(int index, u32 *fourcc);
-
/**
* ipu_image_convert_adjust() - adjust input/output images to IPU restrictions.
*
@@ -176,23 +163,4 @@ ipu_image_convert(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
ipu_image_convert_cb_t complete,
void *complete_context);
-/**
- * ipu_image_convert_sync() - synchronous single image conversion request
- *
- * @ipu: the IPU handle to use for the conversion
- * @ic_task: the IC task to use for the conversion
- * @in: input image format
- * @out: output image format
- * @rot_mode: rotation mode
- *
- * Carry out a single image conversion. Returns when the conversion
- * completes. The input/output formats and rotation mode must already
- * meet IPU retrictions. The created context is automatically unprepared
- * and the run freed on return.
- */
-int ipu_image_convert_sync(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
- struct ipu_image *in, struct ipu_image *out,
- enum ipu_rotate_mode rot_mode);
-
-
#endif /* __IMX_IPU_IMAGE_CONVERT_H__ */
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/7] gpu: ipu-v3: Remove unused ipu_vdi_unsetup
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
` (3 preceding siblings ...)
2024-12-26 2:27 ` [PATCH 4/7] gpu: ipu-v3: Remove unused ipu_image_convert_* functions linux
@ 2024-12-26 2:27 ` linux
2024-12-26 2:27 ` [PATCH 6/7] gpu: ipu-v3: ipu-csi: Remove unused functions linux
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
ipu_vdi_unsetup() was added in 2016 by
commit 2d2ead453077 ("gpu: ipu-v3: Add Video Deinterlacer unit")
but has remained unused.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-vdi.c | 11 -----------
include/video/imx-ipu-v3.h | 1 -
2 files changed, 12 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-vdi.c b/drivers/gpu/ipu-v3/ipu-vdi.c
index a593b232b6d3..af9631fd4256 100644
--- a/drivers/gpu/ipu-v3/ipu-vdi.c
+++ b/drivers/gpu/ipu-v3/ipu-vdi.c
@@ -150,17 +150,6 @@ void ipu_vdi_setup(struct ipu_vdi *vdi, u32 code, int xres, int yres)
}
EXPORT_SYMBOL_GPL(ipu_vdi_setup);
-void ipu_vdi_unsetup(struct ipu_vdi *vdi)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&vdi->lock, flags);
- ipu_vdi_write(vdi, 0, VDI_FSIZE);
- ipu_vdi_write(vdi, 0, VDI_C);
- spin_unlock_irqrestore(&vdi->lock, flags);
-}
-EXPORT_SYMBOL_GPL(ipu_vdi_unsetup);
-
int ipu_vdi_enable(struct ipu_vdi *vdi)
{
unsigned long flags;
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 8870f65c9a8b..c9ed4b6a408b 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -463,7 +463,6 @@ struct ipu_vdi;
void ipu_vdi_set_field_order(struct ipu_vdi *vdi, v4l2_std_id std, u32 field);
void ipu_vdi_set_motion(struct ipu_vdi *vdi, enum ipu_motion_sel motion_sel);
void ipu_vdi_setup(struct ipu_vdi *vdi, u32 code, int xres, int yres);
-void ipu_vdi_unsetup(struct ipu_vdi *vdi);
int ipu_vdi_enable(struct ipu_vdi *vdi);
int ipu_vdi_disable(struct ipu_vdi *vdi);
struct ipu_vdi *ipu_vdi_get(struct ipu_soc *ipu);
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/7] gpu: ipu-v3: ipu-csi: Remove unused functions
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
` (4 preceding siblings ...)
2024-12-26 2:27 ` [PATCH 5/7] gpu: ipu-v3: Remove unused ipu_vdi_unsetup linux
@ 2024-12-26 2:27 ` linux
2024-12-26 2:27 ` [PATCH 7/7] gpu: ipu-v3 ipu-cpmem: " linux
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
ipu_csi_get_window(), ipu_csi_is_interlaced() and
ipu_csi_set_test_generator() were added in 2014 by
commit 2ffd48f2e7ae ("gpu: ipu-v3: Add Camera Sensor Interface unit")
but have remained unused.
Remove them.
ipu_csi_set_testgen_mclk() is now unused.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-csi.c | 108 -----------------------------------
include/video/imx-ipu-v3.h | 5 --
2 files changed, 113 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index 778bc26d3ba5..d576b7d28437 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -185,32 +185,6 @@ static inline void ipu_csi_write(struct ipu_csi *csi, u32 value,
writel(value, csi->base + offset);
}
-/*
- * Set mclk division ratio for generating test mode mclk. Only used
- * for test generator.
- */
-static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, u32 pixel_clk,
- u32 ipu_clk)
-{
- u32 temp;
- int div_ratio;
-
- div_ratio = (ipu_clk / pixel_clk) - 1;
-
- if (div_ratio > 0xFF || div_ratio < 0) {
- dev_err(csi->ipu->dev,
- "value of pixel_clk extends normal range\n");
- return -EINVAL;
- }
-
- temp = ipu_csi_read(csi, CSI_SENS_CONF);
- temp &= ~CSI_SENS_CONF_DIVRATIO_MASK;
- ipu_csi_write(csi, temp | (div_ratio << CSI_SENS_CONF_DIVRATIO_SHIFT),
- CSI_SENS_CONF);
-
- return 0;
-}
-
/*
* Find the CSI data format and data width for the given V4L2 media
* bus pixel format code.
@@ -538,56 +512,6 @@ int ipu_csi_init_interface(struct ipu_csi *csi,
}
EXPORT_SYMBOL_GPL(ipu_csi_init_interface);
-bool ipu_csi_is_interlaced(struct ipu_csi *csi)
-{
- unsigned long flags;
- u32 sensor_protocol;
-
- spin_lock_irqsave(&csi->lock, flags);
- sensor_protocol =
- (ipu_csi_read(csi, CSI_SENS_CONF) &
- CSI_SENS_CONF_SENS_PRTCL_MASK) >>
- CSI_SENS_CONF_SENS_PRTCL_SHIFT;
- spin_unlock_irqrestore(&csi->lock, flags);
-
- switch (sensor_protocol) {
- case IPU_CSI_CLK_MODE_GATED_CLK:
- case IPU_CSI_CLK_MODE_NONGATED_CLK:
- case IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE:
- case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_DDR:
- case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR:
- return false;
- case IPU_CSI_CLK_MODE_CCIR656_INTERLACED:
- case IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_DDR:
- case IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_SDR:
- return true;
- default:
- dev_err(csi->ipu->dev,
- "CSI %d sensor protocol unsupported\n", csi->id);
- return false;
- }
-}
-EXPORT_SYMBOL_GPL(ipu_csi_is_interlaced);
-
-void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w)
-{
- unsigned long flags;
- u32 reg;
-
- spin_lock_irqsave(&csi->lock, flags);
-
- reg = ipu_csi_read(csi, CSI_ACT_FRM_SIZE);
- w->width = (reg & 0xFFFF) + 1;
- w->height = (reg >> 16 & 0xFFFF) + 1;
-
- reg = ipu_csi_read(csi, CSI_OUT_FRM_CTRL);
- w->left = (reg & CSI_HSC_MASK) >> CSI_HSC_SHIFT;
- w->top = (reg & CSI_VSC_MASK) >> CSI_VSC_SHIFT;
-
- spin_unlock_irqrestore(&csi->lock, flags);
-}
-EXPORT_SYMBOL_GPL(ipu_csi_get_window);
-
void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w)
{
unsigned long flags;
@@ -624,38 +548,6 @@ void ipu_csi_set_downsize(struct ipu_csi *csi, bool horiz, bool vert)
}
EXPORT_SYMBOL_GPL(ipu_csi_set_downsize);
-void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active,
- u32 r_value, u32 g_value, u32 b_value,
- u32 pix_clk)
-{
- unsigned long flags;
- u32 ipu_clk = clk_get_rate(csi->clk_ipu);
- u32 temp;
-
- spin_lock_irqsave(&csi->lock, flags);
-
- temp = ipu_csi_read(csi, CSI_TST_CTRL);
-
- if (!active) {
- temp &= ~CSI_TEST_GEN_MODE_EN;
- ipu_csi_write(csi, temp, CSI_TST_CTRL);
- } else {
- /* Set sensb_mclk div_ratio */
- ipu_csi_set_testgen_mclk(csi, pix_clk, ipu_clk);
-
- temp &= ~(CSI_TEST_GEN_R_MASK | CSI_TEST_GEN_G_MASK |
- CSI_TEST_GEN_B_MASK);
- temp |= CSI_TEST_GEN_MODE_EN;
- temp |= (r_value << CSI_TEST_GEN_R_SHIFT) |
- (g_value << CSI_TEST_GEN_G_SHIFT) |
- (b_value << CSI_TEST_GEN_B_SHIFT);
- ipu_csi_write(csi, temp, CSI_TST_CTRL);
- }
-
- spin_unlock_irqrestore(&csi->lock, flags);
-}
-EXPORT_SYMBOL_GPL(ipu_csi_set_test_generator);
-
int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc,
struct v4l2_mbus_framefmt *mbus_fmt)
{
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index c9ed4b6a408b..29e142e95ba3 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -361,13 +361,8 @@ int ipu_csi_init_interface(struct ipu_csi *csi,
const struct v4l2_mbus_config *mbus_cfg,
const struct v4l2_mbus_framefmt *infmt,
const struct v4l2_mbus_framefmt *outfmt);
-bool ipu_csi_is_interlaced(struct ipu_csi *csi);
-void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w);
void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w);
void ipu_csi_set_downsize(struct ipu_csi *csi, bool horiz, bool vert);
-void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active,
- u32 r_value, u32 g_value, u32 b_value,
- u32 pix_clk);
int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc,
struct v4l2_mbus_framefmt *mbus_fmt);
int ipu_csi_set_skip_smfc(struct ipu_csi *csi, u32 skip,
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 7/7] gpu: ipu-v3 ipu-cpmem: Remove unused functions
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
` (5 preceding siblings ...)
2024-12-26 2:27 ` [PATCH 6/7] gpu: ipu-v3: ipu-csi: Remove unused functions linux
@ 2024-12-26 2:27 ` linux
2024-12-29 4:50 ` [PATCH 0/7] gpu: ipu-v3: " Dmitry Baryshkov
2025-03-01 10:03 ` Dmitry Baryshkov
8 siblings, 0 replies; 12+ messages in thread
From: linux @ 2024-12-26 2:27 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
ipu_cpmem_set_yuv_interleaved() was added in 2012 by
commit 0125f21b2baf ("staging: drm/imx: Add
ipu_cpmem_set_yuv_interleaved()")
but has remained unused.
ipu_cpmem_get_burstsize() was added in 2016 by
commit 03085911d7bb ("gpu: ipu-cpmem: Add ipu_cpmem_get_burstsize()")
but has remained unused.
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/ipu-v3/ipu-cpmem.c | 23 -----------------------
include/video/imx-ipu-v3.h | 2 --
2 files changed, 25 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c
index 82b244cb313e..07866b1369c6 100644
--- a/drivers/gpu/ipu-v3/ipu-cpmem.c
+++ b/drivers/gpu/ipu-v3/ipu-cpmem.c
@@ -337,12 +337,6 @@ void ipu_cpmem_set_axi_id(struct ipuv3_channel *ch, u32 id)
}
EXPORT_SYMBOL_GPL(ipu_cpmem_set_axi_id);
-int ipu_cpmem_get_burstsize(struct ipuv3_channel *ch)
-{
- return ipu_ch_param_read_field(ch, IPU_FIELD_NPB) + 1;
-}
-EXPORT_SYMBOL_GPL(ipu_cpmem_get_burstsize);
-
void ipu_cpmem_set_burstsize(struct ipuv3_channel *ch, int burstsize)
{
ipu_ch_param_write_field(ch, IPU_FIELD_NPB, burstsize - 1);
@@ -452,23 +446,6 @@ int ipu_cpmem_set_format_passthrough(struct ipuv3_channel *ch, int width)
}
EXPORT_SYMBOL_GPL(ipu_cpmem_set_format_passthrough);
-void ipu_cpmem_set_yuv_interleaved(struct ipuv3_channel *ch, u32 pixel_format)
-{
- switch (pixel_format) {
- case V4L2_PIX_FMT_UYVY:
- ipu_ch_param_write_field(ch, IPU_FIELD_BPP, 3); /* bits/pixel */
- ipu_ch_param_write_field(ch, IPU_FIELD_PFS, 0xA);/* pix fmt */
- ipu_ch_param_write_field(ch, IPU_FIELD_NPB, 31);/* burst size */
- break;
- case V4L2_PIX_FMT_YUYV:
- ipu_ch_param_write_field(ch, IPU_FIELD_BPP, 3); /* bits/pixel */
- ipu_ch_param_write_field(ch, IPU_FIELD_PFS, 0x8);/* pix fmt */
- ipu_ch_param_write_field(ch, IPU_FIELD_NPB, 31);/* burst size */
- break;
- }
-}
-EXPORT_SYMBOL_GPL(ipu_cpmem_set_yuv_interleaved);
-
void ipu_cpmem_set_yuv_planar_full(struct ipuv3_channel *ch,
unsigned int uv_stride,
unsigned int u_offset, unsigned int v_offset)
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 29e142e95ba3..c89574b6f527 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -262,7 +262,6 @@ void ipu_cpmem_set_uv_offset(struct ipuv3_channel *ch, u32 u_off, u32 v_off);
void ipu_cpmem_interlaced_scan(struct ipuv3_channel *ch, int stride,
u32 pixelformat);
void ipu_cpmem_set_axi_id(struct ipuv3_channel *ch, u32 id);
-int ipu_cpmem_get_burstsize(struct ipuv3_channel *ch);
void ipu_cpmem_set_burstsize(struct ipuv3_channel *ch, int burstsize);
void ipu_cpmem_set_block_mode(struct ipuv3_channel *ch);
void ipu_cpmem_set_rotation(struct ipuv3_channel *ch,
@@ -270,7 +269,6 @@ void ipu_cpmem_set_rotation(struct ipuv3_channel *ch,
int ipu_cpmem_set_format_rgb(struct ipuv3_channel *ch,
const struct ipu_rgb *rgb);
int ipu_cpmem_set_format_passthrough(struct ipuv3_channel *ch, int width);
-void ipu_cpmem_set_yuv_interleaved(struct ipuv3_channel *ch, u32 pixel_format);
void ipu_cpmem_set_yuv_planar_full(struct ipuv3_channel *ch,
unsigned int uv_stride,
unsigned int u_offset,
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 0/7] gpu: ipu-v3: Remove unused functions
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
` (6 preceding siblings ...)
2024-12-26 2:27 ` [PATCH 7/7] gpu: ipu-v3 ipu-cpmem: " linux
@ 2024-12-29 4:50 ` Dmitry Baryshkov
2025-02-28 15:42 ` Dr. David Alan Gilbert
2025-03-01 10:03 ` Dmitry Baryshkov
8 siblings, 1 reply; 12+ messages in thread
From: Dmitry Baryshkov @ 2024-12-29 4:50 UTC (permalink / raw)
To: linux
Cc: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam, dri-devel, linux-fbdev, imx, linux-arm-kernel,
linux-kernel
On Thu, Dec 26, 2024 at 02:27:45AM +0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
> This set removes a bunch of functions in ipu-v3 that
> have been unused for a long time (since 2012-2017).
>
> No changes to functions are made, just full deletions.
>
> Build tested only.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
For the series:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/7] gpu: ipu-v3: Remove unused functions
2024-12-29 4:50 ` [PATCH 0/7] gpu: ipu-v3: " Dmitry Baryshkov
@ 2025-02-28 15:42 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2025-02-28 15:42 UTC (permalink / raw)
To: tzimmermann, airlied, simona
Cc: Dmitry Baryshkov, p.zabel, deller, shawnguo, s.hauer, kernel,
festevam, dri-devel, linux-fbdev, imx, linux-arm-kernel,
linux-kernel
Hi All,
* Dmitry Baryshkov (dmitry.baryshkov@linaro.org) wrote:
> On Thu, Dec 26, 2024 at 02:27:45AM +0000, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > Hi,
> > This set removes a bunch of functions in ipu-v3 that
> > have been unused for a long time (since 2012-2017).
> >
> > No changes to functions are made, just full deletions.
> >
> > Build tested only.
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> >
>
>
> For the series:
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Could this be picked up for drm please?
Thanks,
Dave
> --
> With best wishes
> Dmitry
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/7] gpu: ipu-v3: Remove unused functions
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
` (7 preceding siblings ...)
2024-12-29 4:50 ` [PATCH 0/7] gpu: ipu-v3: " Dmitry Baryshkov
@ 2025-03-01 10:03 ` Dmitry Baryshkov
2025-03-01 12:35 ` Dr. David Alan Gilbert
8 siblings, 1 reply; 12+ messages in thread
From: Dmitry Baryshkov @ 2025-03-01 10:03 UTC (permalink / raw)
To: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam, linux
Cc: dri-devel, linux-fbdev, imx, linux-arm-kernel, linux-kernel
On Thu, 26 Dec 2024 02:27:45 +0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
> This set removes a bunch of functions in ipu-v3 that
> have been unused for a long time (since 2012-2017).
>
> No changes to functions are made, just full deletions.
>
> [...]
Applied to drm-misc-next, thanks!
[1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init
commit: 16e3bf497fb2d379f3d461fa0c85d14de0a3d183
[2/7] gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees
commit: a52ba18c254c0a3819e632e6371554f1c6f5bd16
[3/7] gpu: ipu-v3: Remove unused ipu_idmac_channel_busy
commit: 4f9c64e95c3510f4a5192bd401de5611c1dd5637
[4/7] gpu: ipu-v3: Remove unused ipu_image_convert_* functions
commit: 96e9d754b35e87a5be2de7dce3c810ffdd769c84
[5/7] gpu: ipu-v3: Remove unused ipu_vdi_unsetup
commit: 27985c86e283e1e5ac8a9809f189f03643a6f5f2
[6/7] gpu: ipu-v3: ipu-csi: Remove unused functions
commit: c687c3147d5de801ed835b077802b68fe85d8a3d
[7/7] gpu: ipu-v3 ipu-cpmem: Remove unused functions
commit: 2800028d5bdee8e9a3cda2fec782dadc32225d8d
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/7] gpu: ipu-v3: Remove unused functions
2025-03-01 10:03 ` Dmitry Baryshkov
@ 2025-03-01 12:35 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2025-03-01 12:35 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: p.zabel, airlied, simona, deller, shawnguo, s.hauer, kernel,
festevam, dri-devel, linux-fbdev, imx, linux-arm-kernel,
linux-kernel
* Dmitry Baryshkov (dmitry.baryshkov@linaro.org) wrote:
> On Thu, 26 Dec 2024 02:27:45 +0000, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > Hi,
> > This set removes a bunch of functions in ipu-v3 that
> > have been unused for a long time (since 2012-2017).
> >
> > No changes to functions are made, just full deletions.
> >
> > [...]
>
> Applied to drm-misc-next, thanks!
Thanks!
Dave
> [1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init
> commit: 16e3bf497fb2d379f3d461fa0c85d14de0a3d183
> [2/7] gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees
> commit: a52ba18c254c0a3819e632e6371554f1c6f5bd16
> [3/7] gpu: ipu-v3: Remove unused ipu_idmac_channel_busy
> commit: 4f9c64e95c3510f4a5192bd401de5611c1dd5637
> [4/7] gpu: ipu-v3: Remove unused ipu_image_convert_* functions
> commit: 96e9d754b35e87a5be2de7dce3c810ffdd769c84
> [5/7] gpu: ipu-v3: Remove unused ipu_vdi_unsetup
> commit: 27985c86e283e1e5ac8a9809f189f03643a6f5f2
> [6/7] gpu: ipu-v3: ipu-csi: Remove unused functions
> commit: c687c3147d5de801ed835b077802b68fe85d8a3d
> [7/7] gpu: ipu-v3 ipu-cpmem: Remove unused functions
> commit: 2800028d5bdee8e9a3cda2fec782dadc32225d8d
>
> Best regards,
> --
> With best wishes
> Dmitry
>
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-03-01 12:37 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 2:27 [PATCH 0/7] gpu: ipu-v3: Remove unused functions linux
2024-12-26 2:27 ` [PATCH 1/7] gpu: ipu-v3: ipu-ic: Remove unused ipu_ic_task_graphics_init linux
2024-12-26 2:27 ` [PATCH 2/7] gpu: ipu-v3: Remove unused ipu_rot_mode_to_degrees linux
2024-12-26 2:27 ` [PATCH 3/7] gpu: ipu-v3: Remove unused ipu_idmac_channel_busy linux
2024-12-26 2:27 ` [PATCH 4/7] gpu: ipu-v3: Remove unused ipu_image_convert_* functions linux
2024-12-26 2:27 ` [PATCH 5/7] gpu: ipu-v3: Remove unused ipu_vdi_unsetup linux
2024-12-26 2:27 ` [PATCH 6/7] gpu: ipu-v3: ipu-csi: Remove unused functions linux
2024-12-26 2:27 ` [PATCH 7/7] gpu: ipu-v3 ipu-cpmem: " linux
2024-12-29 4:50 ` [PATCH 0/7] gpu: ipu-v3: " Dmitry Baryshkov
2025-02-28 15:42 ` Dr. David Alan Gilbert
2025-03-01 10:03 ` Dmitry Baryshkov
2025-03-01 12:35 ` Dr. David Alan Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).