Skip to content

Commit dac62bc

Browse files
committed
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 <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 96f4418 commit dac62bc

File tree

9 files changed

+144
-200
lines changed

9 files changed

+144
-200
lines changed

drivers/gpu/drm/omapdrm/dss/base.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ struct dispc_device *dispc_get_dispc(struct dss_device *dss)
2121
return dss->dispc;
2222
}
2323

24-
const struct dispc_ops *dispc_get_ops(struct dss_device *dss)
25-
{
26-
return dss->dispc_ops;
27-
}
28-
2924
/* -----------------------------------------------------------------------------
3025
* OMAP DSS Devices Handling
3126
*/

drivers/gpu/drm/omapdrm/dss/dispc.c

Lines changed: 28 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ static unsigned long dispc_plane_pclk_rate(struct dispc_device *dispc,
351351
static unsigned long dispc_plane_lclk_rate(struct dispc_device *dispc,
352352
enum omap_plane_id plane);
353353

354-
static void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask);
355-
356354
static inline void dispc_write_reg(struct dispc_device *dispc, u16 idx, u32 val)
357355
{
358356
__raw_writel(val, dispc->base + idx);
@@ -379,12 +377,12 @@ static void mgr_fld_write(struct dispc_device *dispc, enum omap_channel channel,
379377
REG_FLD_MOD(dispc, rfld->reg, val, rfld->high, rfld->low);
380378
}
381379

382-
static int dispc_get_num_ovls(struct dispc_device *dispc)
380+
int dispc_get_num_ovls(struct dispc_device *dispc)
383381
{
384382
return dispc->feat->num_ovls;
385383
}
386384

387-
static int dispc_get_num_mgrs(struct dispc_device *dispc)
385+
int dispc_get_num_mgrs(struct dispc_device *dispc)
388386
{
389387
return dispc->feat->num_mgrs;
390388
}
@@ -670,13 +668,13 @@ void dispc_runtime_put(struct dispc_device *dispc)
670668
WARN_ON(r < 0 && r != -ENOSYS);
671669
}
672670

673-
static u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc,
671+
u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc,
674672
enum omap_channel channel)
675673
{
676674
return mgr_desc[channel].vsync_irq;
677675
}
678676

679-
static u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc,
677+
u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc,
680678
enum omap_channel channel)
681679
{
682680
if (channel == OMAP_DSS_CHANNEL_DIGIT && dispc->feat->no_framedone_tv)
@@ -685,18 +683,18 @@ static u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc,
685683
return mgr_desc[channel].framedone_irq;
686684
}
687685

688-
static u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc,
686+
u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc,
689687
enum omap_channel channel)
690688
{
691689
return mgr_desc[channel].sync_lost_irq;
692690
}
693691

694-
static u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc)
692+
u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc)
695693
{
696694
return DISPC_IRQ_FRAMEDONEWB;
697695
}
698696

699-
static void dispc_mgr_enable(struct dispc_device *dispc,
697+
void dispc_mgr_enable(struct dispc_device *dispc,
700698
enum omap_channel channel, bool enable)
701699
{
702700
mgr_fld_write(dispc, channel, DISPC_MGR_FLD_ENABLE, enable);
@@ -710,13 +708,13 @@ static bool dispc_mgr_is_enabled(struct dispc_device *dispc,
710708
return !!mgr_fld_read(dispc, channel, DISPC_MGR_FLD_ENABLE);
711709
}
712710

713-
static bool dispc_mgr_go_busy(struct dispc_device *dispc,
711+
bool dispc_mgr_go_busy(struct dispc_device *dispc,
714712
enum omap_channel channel)
715713
{
716714
return mgr_fld_read(dispc, channel, DISPC_MGR_FLD_GO) == 1;
717715
}
718716

719-
static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel)
717+
void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel)
720718
{
721719
WARN_ON(!dispc_mgr_is_enabled(dispc, channel));
722720
WARN_ON(dispc_mgr_go_busy(dispc, channel));
@@ -726,12 +724,12 @@ static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel)
726724
mgr_fld_write(dispc, channel, DISPC_MGR_FLD_GO, 1);
727725
}
728726

729-
static bool dispc_wb_go_busy(struct dispc_device *dispc)
727+
bool dispc_wb_go_busy(struct dispc_device *dispc)
730728
{
731729
return REG_GET(dispc, DISPC_CONTROL2, 6, 6) == 1;
732730
}
733731

734-
static void dispc_wb_go(struct dispc_device *dispc)
732+
void dispc_wb_go(struct dispc_device *dispc)
735733
{
736734
enum omap_plane_id plane = OMAP_DSS_WB;
737735
bool enable, go;
@@ -1297,7 +1295,7 @@ static bool dispc_ovl_color_mode_supported(struct dispc_device *dispc,
12971295
return false;
12981296
}
12991297

1300-
static const u32 *dispc_ovl_get_color_modes(struct dispc_device *dispc,
1298+
const u32 *dispc_ovl_get_color_modes(struct dispc_device *dispc,
13011299
enum omap_plane_id plane)
13021300
{
13031301
return dispc->feat->supported_color_modes[plane];
@@ -2781,7 +2779,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc,
27812779
return 0;
27822780
}
27832781

2784-
static int dispc_ovl_setup(struct dispc_device *dispc,
2782+
int dispc_ovl_setup(struct dispc_device *dispc,
27852783
enum omap_plane_id plane,
27862784
const struct omap_overlay_info *oi,
27872785
const struct videomode *vm, bool mem_to_mem,
@@ -2809,7 +2807,7 @@ static int dispc_ovl_setup(struct dispc_device *dispc,
28092807
return r;
28102808
}
28112809

2812-
static int dispc_wb_setup(struct dispc_device *dispc,
2810+
int dispc_wb_setup(struct dispc_device *dispc,
28132811
const struct omap_dss_writeback_info *wi,
28142812
bool mem_to_mem, const struct videomode *vm,
28152813
enum dss_writeback_channel channel_in)
@@ -2893,12 +2891,12 @@ static int dispc_wb_setup(struct dispc_device *dispc,
28932891
return 0;
28942892
}
28952893

2896-
static bool dispc_has_writeback(struct dispc_device *dispc)
2894+
bool dispc_has_writeback(struct dispc_device *dispc)
28972895
{
28982896
return dispc->feat->has_writeback;
28992897
}
29002898

2901-
static int dispc_ovl_enable(struct dispc_device *dispc,
2899+
int dispc_ovl_enable(struct dispc_device *dispc,
29022900
enum omap_plane_id plane, bool enable)
29032901
{
29042902
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
@@ -2989,7 +2987,7 @@ static void dispc_mgr_enable_alpha_fixed_zorder(struct dispc_device *dispc,
29892987
REG_FLD_MOD(dispc, DISPC_CONFIG, enable, 19, 19);
29902988
}
29912989

2992-
static void dispc_mgr_setup(struct dispc_device *dispc,
2990+
void dispc_mgr_setup(struct dispc_device *dispc,
29932991
enum omap_channel channel,
29942992
const struct omap_overlay_manager_info *info)
29952993
{
@@ -3068,7 +3066,7 @@ static void dispc_mgr_enable_stallmode(struct dispc_device *dispc,
30683066
mgr_fld_write(dispc, channel, DISPC_MGR_FLD_STALLMODE, enable);
30693067
}
30703068

3071-
static void dispc_mgr_set_lcd_config(struct dispc_device *dispc,
3069+
void dispc_mgr_set_lcd_config(struct dispc_device *dispc,
30723070
enum omap_channel channel,
30733071
const struct dss_lcd_mgr_config *config)
30743072
{
@@ -3117,7 +3115,7 @@ static bool _dispc_mgr_pclk_ok(struct dispc_device *dispc,
31173115
return pclk <= dispc->feat->max_tv_pclk;
31183116
}
31193117

3120-
static int dispc_mgr_check_timings(struct dispc_device *dispc,
3118+
int dispc_mgr_check_timings(struct dispc_device *dispc,
31213119
enum omap_channel channel,
31223120
const struct videomode *vm)
31233121
{
@@ -3210,7 +3208,7 @@ static int vm_flag_to_int(enum display_flags flags, enum display_flags high,
32103208
}
32113209

32123210
/* change name to mode? */
3213-
static void dispc_mgr_set_timings(struct dispc_device *dispc,
3211+
void dispc_mgr_set_timings(struct dispc_device *dispc,
32143212
enum omap_channel channel,
32153213
const struct videomode *vm)
32163214
{
@@ -3754,17 +3752,17 @@ int dispc_mgr_get_clock_div(struct dispc_device *dispc,
37543752
return 0;
37553753
}
37563754

3757-
static u32 dispc_read_irqstatus(struct dispc_device *dispc)
3755+
u32 dispc_read_irqstatus(struct dispc_device *dispc)
37583756
{
37593757
return dispc_read_reg(dispc, DISPC_IRQSTATUS);
37603758
}
37613759

3762-
static void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask)
3760+
void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask)
37633761
{
37643762
dispc_write_reg(dispc, DISPC_IRQSTATUS, mask);
37653763
}
37663764

3767-
static void dispc_write_irqenable(struct dispc_device *dispc, u32 mask)
3765+
void dispc_write_irqenable(struct dispc_device *dispc, u32 mask)
37683766
{
37693767
u32 old_mask = dispc_read_reg(dispc, DISPC_IRQENABLE);
37703768

@@ -3788,7 +3786,7 @@ void dispc_disable_sidle(struct dispc_device *dispc)
37883786
REG_FLD_MOD(dispc, DISPC_SYSCONFIG, 1, 4, 3); /* SIDLEMODE: no idle */
37893787
}
37903788

3791-
static u32 dispc_mgr_gamma_size(struct dispc_device *dispc,
3789+
u32 dispc_mgr_gamma_size(struct dispc_device *dispc,
37923790
enum omap_channel channel)
37933791
{
37943792
const struct dispc_gamma_desc *gdesc = &mgr_desc[channel].gamma;
@@ -3843,7 +3841,7 @@ static const struct drm_color_lut dispc_mgr_gamma_default_lut[] = {
38433841
{ .red = U16_MAX, .green = U16_MAX, .blue = U16_MAX, },
38443842
};
38453843

3846-
static void dispc_mgr_set_gamma(struct dispc_device *dispc,
3844+
void dispc_mgr_set_gamma(struct dispc_device *dispc,
38473845
enum omap_channel channel,
38483846
const struct drm_color_lut *lut,
38493847
unsigned int length)
@@ -4499,7 +4497,7 @@ static irqreturn_t dispc_irq_handler(int irq, void *arg)
44994497
return dispc->user_handler(irq, dispc->user_data);
45004498
}
45014499

4502-
static int dispc_request_irq(struct dispc_device *dispc, irq_handler_t handler,
4500+
int dispc_request_irq(struct dispc_device *dispc, irq_handler_t handler,
45034501
void *dev_id)
45044502
{
45054503
int r;
@@ -4523,15 +4521,15 @@ static int dispc_request_irq(struct dispc_device *dispc, irq_handler_t handler,
45234521
return r;
45244522
}
45254523

4526-
static void dispc_free_irq(struct dispc_device *dispc, void *dev_id)
4524+
void dispc_free_irq(struct dispc_device *dispc, void *dev_id)
45274525
{
45284526
devm_free_irq(&dispc->pdev->dev, dispc->irq, dispc);
45294527

45304528
dispc->user_handler = NULL;
45314529
dispc->user_data = NULL;
45324530
}
45334531

4534-
static u32 dispc_get_memory_bandwidth_limit(struct dispc_device *dispc)
4532+
u32 dispc_get_memory_bandwidth_limit(struct dispc_device *dispc)
45354533
{
45364534
u32 limit = 0;
45374535

@@ -4701,47 +4699,6 @@ static void dispc_errata_i734_wa(struct dispc_device *dispc)
47014699
REG_FLD_MOD(dispc, DISPC_CONFIG, gatestate, 8, 4);
47024700
}
47034701

4704-
static const struct dispc_ops dispc_ops = {
4705-
.read_irqstatus = dispc_read_irqstatus,
4706-
.clear_irqstatus = dispc_clear_irqstatus,
4707-
.write_irqenable = dispc_write_irqenable,
4708-
4709-
.request_irq = dispc_request_irq,
4710-
.free_irq = dispc_free_irq,
4711-
4712-
.runtime_get = dispc_runtime_get,
4713-
.runtime_put = dispc_runtime_put,
4714-
4715-
.get_num_ovls = dispc_get_num_ovls,
4716-
.get_num_mgrs = dispc_get_num_mgrs,
4717-
4718-
.get_memory_bandwidth_limit = dispc_get_memory_bandwidth_limit,
4719-
4720-
.mgr_enable = dispc_mgr_enable,
4721-
.mgr_is_enabled = dispc_mgr_is_enabled,
4722-
.mgr_get_vsync_irq = dispc_mgr_get_vsync_irq,
4723-
.mgr_get_framedone_irq = dispc_mgr_get_framedone_irq,
4724-
.mgr_get_sync_lost_irq = dispc_mgr_get_sync_lost_irq,
4725-
.mgr_go_busy = dispc_mgr_go_busy,
4726-
.mgr_go = dispc_mgr_go,
4727-
.mgr_set_lcd_config = dispc_mgr_set_lcd_config,
4728-
.mgr_check_timings = dispc_mgr_check_timings,
4729-
.mgr_set_timings = dispc_mgr_set_timings,
4730-
.mgr_setup = dispc_mgr_setup,
4731-
.mgr_gamma_size = dispc_mgr_gamma_size,
4732-
.mgr_set_gamma = dispc_mgr_set_gamma,
4733-
4734-
.ovl_enable = dispc_ovl_enable,
4735-
.ovl_setup = dispc_ovl_setup,
4736-
.ovl_get_color_modes = dispc_ovl_get_color_modes,
4737-
4738-
.wb_get_framedone_irq = dispc_wb_get_framedone_irq,
4739-
.wb_setup = dispc_wb_setup,
4740-
.has_writeback = dispc_has_writeback,
4741-
.wb_go_busy = dispc_wb_go_busy,
4742-
.wb_go = dispc_wb_go,
4743-
};
4744-
47454702
/* DISPC HW IP initialisation */
47464703
static const struct of_device_id dispc_of_match[] = {
47474704
{ .compatible = "ti,omap2-dispc", .data = &omap24xx_dispc_feats },
@@ -4843,7 +4800,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
48434800
dispc_runtime_put(dispc);
48444801

48454802
dss->dispc = dispc;
4846-
dss->dispc_ops = &dispc_ops;
48474803

48484804
dispc->debugfs = dss_debugfs_create_file(dss, "dispc", dispc_dump_regs,
48494805
dispc);
@@ -4865,7 +4821,6 @@ static void dispc_unbind(struct device *dev, struct device *master, void *data)
48654821
dss_debugfs_remove_file(dispc->debugfs);
48664822

48674823
dss->dispc = NULL;
4868-
dss->dispc_ops = NULL;
48694824

48704825
pm_runtime_disable(dev);
48714826

drivers/gpu/drm/omapdrm/dss/dss.h

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ struct dss_device {
257257
struct dss_pll *video2_pll;
258258

259259
struct dispc_device *dispc;
260-
const struct dispc_ops *dispc_ops;
261260
const struct dss_mgr_ops *mgr_ops;
262261
struct omap_drm_private *mgr_ops_priv;
263262
};
@@ -393,6 +392,76 @@ void dispc_dump_clocks(struct dispc_device *dispc, struct seq_file *s);
393392
int dispc_runtime_get(struct dispc_device *dispc);
394393
void dispc_runtime_put(struct dispc_device *dispc);
395394

395+
int dispc_get_num_ovls(struct dispc_device *dispc);
396+
int dispc_get_num_mgrs(struct dispc_device *dispc);
397+
398+
const u32 *dispc_ovl_get_color_modes(struct dispc_device *dispc,
399+
enum omap_plane_id plane);
400+
401+
u32 dispc_read_irqstatus(struct dispc_device *dispc);
402+
void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask);
403+
void dispc_write_irqenable(struct dispc_device *dispc, u32 mask);
404+
405+
int dispc_request_irq(struct dispc_device *dispc, irq_handler_t handler,
406+
void *dev_id);
407+
void dispc_free_irq(struct dispc_device *dispc, void *dev_id);
408+
409+
u32 dispc_mgr_get_vsync_irq(struct dispc_device *dispc,
410+
enum omap_channel channel);
411+
u32 dispc_mgr_get_framedone_irq(struct dispc_device *dispc,
412+
enum omap_channel channel);
413+
u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc,
414+
enum omap_channel channel);
415+
u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc);
416+
417+
u32 dispc_get_memory_bandwidth_limit(struct dispc_device *dispc);
418+
419+
void dispc_mgr_enable(struct dispc_device *dispc,
420+
enum omap_channel channel, bool enable);
421+
422+
bool dispc_mgr_go_busy(struct dispc_device *dispc,
423+
enum omap_channel channel);
424+
425+
void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel);
426+
427+
void dispc_mgr_set_lcd_config(struct dispc_device *dispc,
428+
enum omap_channel channel,
429+
const struct dss_lcd_mgr_config *config);
430+
void dispc_mgr_set_timings(struct dispc_device *dispc,
431+
enum omap_channel channel,
432+
const struct videomode *vm);
433+
void dispc_mgr_setup(struct dispc_device *dispc,
434+
enum omap_channel channel,
435+
const struct omap_overlay_manager_info *info);
436+
437+
int dispc_mgr_check_timings(struct dispc_device *dispc,
438+
enum omap_channel channel,
439+
const struct videomode *vm);
440+
441+
u32 dispc_mgr_gamma_size(struct dispc_device *dispc,
442+
enum omap_channel channel);
443+
void dispc_mgr_set_gamma(struct dispc_device *dispc,
444+
enum omap_channel channel,
445+
const struct drm_color_lut *lut,
446+
unsigned int length);
447+
448+
int dispc_ovl_setup(struct dispc_device *dispc,
449+
enum omap_plane_id plane,
450+
const struct omap_overlay_info *oi,
451+
const struct videomode *vm, bool mem_to_mem,
452+
enum omap_channel channel);
453+
454+
int dispc_ovl_enable(struct dispc_device *dispc,
455+
enum omap_plane_id plane, bool enable);
456+
457+
bool dispc_has_writeback(struct dispc_device *dispc);
458+
int dispc_wb_setup(struct dispc_device *dispc,
459+
const struct omap_dss_writeback_info *wi,
460+
bool mem_to_mem, const struct videomode *vm,
461+
enum dss_writeback_channel channel_in);
462+
bool dispc_wb_go_busy(struct dispc_device *dispc);
463+
void dispc_wb_go(struct dispc_device *dispc);
464+
396465
void dispc_enable_sidle(struct dispc_device *dispc);
397466
void dispc_disable_sidle(struct dispc_device *dispc);
398467

0 commit comments

Comments
 (0)