Re: [PATCH v3 55/56] drm/omap: remove dispc_ops
Hi Tomi, Thank you for the patch. On Thu, Nov 05, 2020 at 02:03:32PM +0200, Tomi Valkeinen wrote: > dispc_ops was created to help with the multi-module architecture and > giving us the possibility of multiple dispc implementations. Neither of > these is valid anymore, and we can remove dispc_ops and use direct > calls to dispc. > > Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart > --- > drivers/gpu/drm/omapdrm/dss/base.c| 6 -- > drivers/gpu/drm/omapdrm/dss/dispc.c | 101 +++--- > drivers/gpu/drm/omapdrm/dss/dss.h | 71 +- > drivers/gpu/drm/omapdrm/dss/omapdss.h | 71 -- > drivers/gpu/drm/omapdrm/omap_crtc.c | 30 > drivers/gpu/drm/omapdrm/omap_drv.c| 15 ++-- > drivers/gpu/drm/omapdrm/omap_drv.h| 2 +- > drivers/gpu/drm/omapdrm/omap_irq.c| 34 - > drivers/gpu/drm/omapdrm/omap_plane.c | 12 +-- > 9 files changed, 143 insertions(+), 199 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/dss/base.c > b/drivers/gpu/drm/omapdrm/dss/base.c > index 08c7c5024896..0aff16bf6edb 100644 > --- a/drivers/gpu/drm/omapdrm/dss/base.c > +++ b/drivers/gpu/drm/omapdrm/dss/base.c > @@ -21,12 +21,6 @@ struct dispc_device *dispc_get_dispc(struct dss_device > *dss) > return dss->dispc; > } > > -const struct dispc_ops *dispc_get_ops(struct dss_device *dss) > -{ > - return dss->dispc_ops; > -} > - > - > /* > - > * OMAP DSS Devices Handling > */ > diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c > b/drivers/gpu/drm/omapdrm/dss/dispc.c > index 48593932bddf..509bac99cb57 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dispc.c > +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c > @@ -351,8 +351,6 @@ static unsigned long dispc_plane_pclk_rate(struct > dispc_device *dispc, > static unsigned long dispc_plane_lclk_rate(struct dispc_device *dispc, > enum omap_plane_id plane); > > -static void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask); > - > static inline void dispc_write_reg(struct dispc_device *dispc, u16 idx, u32 > val) > { > __raw_writel(val, dispc->base + idx); > @@ -379,12 +377,12 @@ static void mgr_fld_write(struct dispc_device *dispc, > enum omap_channel channel, > REG_FLD_MOD(dispc, rfld->reg, val, rfld->high, rfld->low); > } > > -static int dispc_get_num_ovls(struct dispc_device *dispc) > +int dispc_get_num_ovls(struct dispc_device *dispc) > { > return dispc->feat->num_ovls; > } > > -static int dispc_get_num_mgrs(struct dispc_device *dispc) > +int dispc_get_num_mgrs(struct dispc_device *dispc) > { > return dispc->feat->num_mgrs; > } > @@ -667,13 +665,13 @@ void dispc_runtime_put(struct dispc_device *dispc) > WARN_ON(r < 0 && r != -ENOSYS); > } > > -static u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc, > +u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc, > enum omap_channel channel) > { > return mgr_desc[channel].vsync_irq; > } > > -static u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc, > +u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc, > enum omap_channel channel) > { > if (channel == OMAP_DSS_CHANNEL_DIGIT && dispc->feat->no_framedone_tv) > @@ -682,18 +680,18 @@ static u32 dispc_mgr_get_framedone_irq(struct > dispc_device *dispc, > return mgr_desc[channel].framedone_irq; > } > > -static u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc, > +u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc, > enum omap_channel channel) > { > return mgr_desc[channel].sync_lost_irq; > } > > -static u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc) > +u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc) > { > return DISPC_IRQ_FRAMEDONEWB; > } > > -static void dispc_mgr_enable(struct dispc_device *dispc, > +void dispc_mgr_enable(struct dispc_device *dispc, >enum omap_channel channel, bool enable) > { > mgr_fld_write(dispc, channel, DISPC_MGR_FLD_ENABLE, enable); > @@ -707,13 +705,13 @@ static bool dispc_mgr_is_enabled(struct dispc_device > *dispc, > return !!mgr_fld_read(dispc, channel, DISPC_MGR_FLD_ENABLE); > } > > -static bool dispc_mgr_go_busy(struct dispc_device *dispc, > +bool dispc_mgr_go_busy(struct dispc_device *dispc, > enum omap_channel channel) > { > return mgr_fld_read(dispc, channel, DISPC_MGR_FLD_GO) == 1; > } > > -static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel > channel) > +void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel) > { > WARN_ON(!dispc_mgr_is_enabled(dispc, channel)); > WARN_ON(dispc_mgr_go_busy(dispc, channel)); > @@ -723,12 +721,12 @@ static void dis
[PATCH v3 55/56] drm/omap: remove dispc_ops
dispc_ops was created to help with the multi-module architecture and giving us the possibility of multiple dispc implementations. Neither of these is valid anymore, and we can remove dispc_ops and use direct calls to dispc. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/base.c| 6 -- drivers/gpu/drm/omapdrm/dss/dispc.c | 101 +++--- drivers/gpu/drm/omapdrm/dss/dss.h | 71 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 71 -- drivers/gpu/drm/omapdrm/omap_crtc.c | 30 drivers/gpu/drm/omapdrm/omap_drv.c| 15 ++-- drivers/gpu/drm/omapdrm/omap_drv.h| 2 +- drivers/gpu/drm/omapdrm/omap_irq.c| 34 - drivers/gpu/drm/omapdrm/omap_plane.c | 12 +-- 9 files changed, 143 insertions(+), 199 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 08c7c5024896..0aff16bf6edb 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -21,12 +21,6 @@ struct dispc_device *dispc_get_dispc(struct dss_device *dss) return dss->dispc; } -const struct dispc_ops *dispc_get_ops(struct dss_device *dss) -{ - return dss->dispc_ops; -} - - /* - * OMAP DSS Devices Handling */ diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 48593932bddf..509bac99cb57 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -351,8 +351,6 @@ static unsigned long dispc_plane_pclk_rate(struct dispc_device *dispc, static unsigned long dispc_plane_lclk_rate(struct dispc_device *dispc, enum omap_plane_id plane); -static void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask); - static inline void dispc_write_reg(struct dispc_device *dispc, u16 idx, u32 val) { __raw_writel(val, dispc->base + idx); @@ -379,12 +377,12 @@ static void mgr_fld_write(struct dispc_device *dispc, enum omap_channel channel, REG_FLD_MOD(dispc, rfld->reg, val, rfld->high, rfld->low); } -static int dispc_get_num_ovls(struct dispc_device *dispc) +int dispc_get_num_ovls(struct dispc_device *dispc) { return dispc->feat->num_ovls; } -static int dispc_get_num_mgrs(struct dispc_device *dispc) +int dispc_get_num_mgrs(struct dispc_device *dispc) { return dispc->feat->num_mgrs; } @@ -667,13 +665,13 @@ void dispc_runtime_put(struct dispc_device *dispc) WARN_ON(r < 0 && r != -ENOSYS); } -static u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc, +u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc, enum omap_channel channel) { return mgr_desc[channel].vsync_irq; } -static u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc, +u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc, enum omap_channel channel) { if (channel == OMAP_DSS_CHANNEL_DIGIT && dispc->feat->no_framedone_tv) @@ -682,18 +680,18 @@ static u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc, return mgr_desc[channel].framedone_irq; } -static u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc, +u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc, enum omap_channel channel) { return mgr_desc[channel].sync_lost_irq; } -static u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc) +u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc) { return DISPC_IRQ_FRAMEDONEWB; } -static void dispc_mgr_enable(struct dispc_device *dispc, +void dispc_mgr_enable(struct dispc_device *dispc, enum omap_channel channel, bool enable) { mgr_fld_write(dispc, channel, DISPC_MGR_FLD_ENABLE, enable); @@ -707,13 +705,13 @@ static bool dispc_mgr_is_enabled(struct dispc_device *dispc, return !!mgr_fld_read(dispc, channel, DISPC_MGR_FLD_ENABLE); } -static bool dispc_mgr_go_busy(struct dispc_device *dispc, +bool dispc_mgr_go_busy(struct dispc_device *dispc, enum omap_channel channel) { return mgr_fld_read(dispc, channel, DISPC_MGR_FLD_GO) == 1; } -static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel) +void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel) { WARN_ON(!dispc_mgr_is_enabled(dispc, channel)); WARN_ON(dispc_mgr_go_busy(dispc, channel)); @@ -723,12 +721,12 @@ static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel) mgr_fld_write(dispc, channel, DISPC_MGR_FLD_GO, 1); } -static bool dispc_wb_go_busy(struct dispc_device *dispc) +bool dispc_wb_go_busy(struct dispc_device *dispc) { return REG_GET(dispc, DISPC_CONTROL2, 6, 6) == 1; } -static void dispc_wb_go(struct disp