media: imx-jpeg: Encoder support to set jpeg quality
PATCH v3 1/1 media: imx-jpeg: Encoder support to set jpeg quality
Implement V4L2_CID_JPEG_COMPRESSION_QUALITY
to set jpeg quality
---
v3
- put this v3 information below the --- line
v2
- free ctrl handler if error is set and return error
Signed-off-by Ming Qian <[email protected]>
--- .../media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c | 11 +++- .../media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h | 1 + .../media/platform/nxp/imx-jpeg/mxc-jpeg.c | 57 +++++++++++++++++++ .../media/platform/nxp/imx-jpeg/mxc-jpeg.h | 2 + 4 files changed, 68 insertions(+), 3 deletions(-)
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c +8 -3
@@ -100,9 +100,6 @@ void mxc_jpeg_enc_mode_conf(struct device *dev, void __iomem *reg)/* all markers and segments */ writel (0x3ff , reg +CAST_CFG_MODE ); - -/* quality factor */ -writel (0x4b , reg +CAST_QUALITY ); }void mxc_jpeg_enc_mode_go (struct device *dev,void __iomem *reg)
@@ -114,6 +111,14 @@ void mxc_jpeg_enc_mode_go(struct device *dev, void __iomem *reg)writel (0x140 , reg +CAST_MODE ); } +void mxc_jpeg_enc_set_quality (struct device *dev,void __iomem *reg,u8 quality) +{ +dev_dbg (dev,"CAST Encoder Quality %d...\n" , quality); + +/* quality factor */ +writel (quality, reg +CAST_QUALITY ); +} +void mxc_jpeg_dec_mode_go (struct device *dev,void __iomem *reg) {dev_dbg (dev,"CAST Decoder GO...\n" );
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h +1 -0
@@ -119,6 +119,7 @@ int mxc_jpeg_enable(void __iomem *reg);void wait_frmdone (struct device *dev,void __iomem *reg);void mxc_jpeg_enc_mode_conf (struct device *dev,void __iomem *reg);void mxc_jpeg_enc_mode_go (struct device *dev,void __iomem *reg); +void mxc_jpeg_enc_set_quality (struct device *dev,void __iomem *reg,u8 quality);void mxc_jpeg_dec_mode_go (struct device *dev,void __iomem *reg);int mxc_jpeg_get_slot (void __iomem *reg);u32 mxc_jpeg_get_offset (void __iomem *reg,int slot);
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +57 -0
93 lines not on this page · raw message
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h +2 -0
@@ -96,6 +96,8 @@ struct mxc_jpeg_ctx {unsigned int slot;unsigned int source_change;bool header_parsed; +struct v4l2_ctrl_handler ctrl_handler; +u8 jpeg_quality; };struct mxc_jpeg_slot_data {
Signature · 1 line
2.35.1
Fabio Estevam
reviewerQuoted 10 lines · Ming Qian
Implement
V4L2_CID_JPEG_COMPRESSION_QUALITY
to set jpeg quality---
v3
- put this v3 information below the --- linev2
- free ctrl handler if error is set and return error
Wrong placement.
Quoted 3 lines
Signed-off-by Ming Qian <[email protected]>---
It is after the Signed-off-by and this --- line that you should put the version history.