Re: [PATCH 10/15] drm/mediatek: Support CRC in display driver

From: AngeloGioacchino Del Regno
Date: Thu Sep 07 2023 - 13:44:53 EST


Il 23/08/23 17:13, Hsiao Chien Sung ha scritto:
Register CRC related function pointers to support CRC
retrieval.

Skip the first CRC because when the first vblank triggered,
the frame buffer is not ready for CRC calculation yet.

Signed-off-by: Hsiao Chien Sung <shawn.sung@xxxxxxxxxxxx>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 53 +++++++++++++++++++++
drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 20 ++++++++
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 5 ++
3 files changed, 78 insertions(+)


..snip..

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
index febcaeef16a1..3b67c3dc0525 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
@@ -45,6 +45,10 @@ enum mtk_ddp_comp_type {
struct mtk_ddp_comp;
struct cmdq_pkt;
+
+/* struct mtk_ddp_comp_funcs - function pointers of the ddp components

While at it, can you at this point just add kerneldoc for the entire structure?
That should be pretty straightforward, and just a 10 minutes job.

Thanks!
Angelo

+ * @crc_cnt: how many CRCs the component supports
+ */
struct mtk_ddp_comp_funcs {
int (*clk_enable)(struct device *dev);
void (*clk_disable)(struct device *dev);
@@ -80,6 +84,7 @@ struct mtk_ddp_comp_funcs {
void (*disconnect)(struct device *dev, struct device *mmsys_dev, unsigned int next);
void (*add)(struct device *dev, struct mtk_mutex *mutex);
void (*remove)(struct device *dev, struct mtk_mutex *mutex);
+ u32 (*crc_cnt)(struct device *dev);
};