@@ -704,7 +704,7 @@ static u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc,
704
704
return mgr_desc [channel ].sync_lost_irq ;
705
705
}
706
706
707
- u32 dispc_wb_get_framedone_irq (void )
707
+ u32 dispc_wb_get_framedone_irq (struct dispc_device * dispc )
708
708
{
709
709
return DISPC_IRQ_FRAMEDONEWB ;
710
710
}
@@ -739,12 +739,12 @@ static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel)
739
739
mgr_fld_write (channel , DISPC_MGR_FLD_GO , 1 );
740
740
}
741
741
742
- bool dispc_wb_go_busy (void )
742
+ bool dispc_wb_go_busy (struct dispc_device * dispc )
743
743
{
744
744
return REG_GET (DISPC_CONTROL2 , 6 , 6 ) == 1 ;
745
745
}
746
746
747
- void dispc_wb_go (void )
747
+ void dispc_wb_go (struct dispc_device * dispc )
748
748
{
749
749
enum omap_plane_id plane = OMAP_DSS_WB ;
750
750
bool enable , go ;
@@ -1196,7 +1196,8 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane_id plane)
1196
1196
}
1197
1197
}
1198
1198
1199
- void dispc_wb_set_channel_in (enum dss_writeback_channel channel )
1199
+ void dispc_wb_set_channel_in (struct dispc_device * dispc ,
1200
+ enum dss_writeback_channel channel )
1200
1201
{
1201
1202
enum omap_plane_id plane = OMAP_DSS_WB ;
1202
1203
@@ -1371,21 +1372,22 @@ static void dispc_init_fifos(void)
1371
1372
const bool use_fifomerge = false;
1372
1373
const bool manual_update = false;
1373
1374
1374
- dispc_ovl_compute_fifo_thresholds (i , & low , & high ,
1375
+ dispc_ovl_compute_fifo_thresholds (& dispc , i , & low , & high ,
1375
1376
use_fifomerge , manual_update );
1376
1377
1377
- dispc_ovl_set_fifo_threshold (i , low , high );
1378
+ dispc_ovl_set_fifo_threshold (& dispc , i , low , high );
1378
1379
}
1379
1380
1380
1381
if (dispc .feat -> has_writeback ) {
1381
1382
u32 low , high ;
1382
1383
const bool use_fifomerge = false;
1383
1384
const bool manual_update = false;
1384
1385
1385
- dispc_ovl_compute_fifo_thresholds (OMAP_DSS_WB , & low , & high ,
1386
- use_fifomerge , manual_update );
1386
+ dispc_ovl_compute_fifo_thresholds (& dispc , OMAP_DSS_WB ,
1387
+ & low , & high ,
1388
+ use_fifomerge , manual_update );
1387
1389
1388
- dispc_ovl_set_fifo_threshold (OMAP_DSS_WB , low , high );
1390
+ dispc_ovl_set_fifo_threshold (& dispc , OMAP_DSS_WB , low , high );
1389
1391
}
1390
1392
}
1391
1393
@@ -1402,13 +1404,14 @@ static u32 dispc_ovl_get_fifo_size(enum omap_plane_id plane)
1402
1404
return size ;
1403
1405
}
1404
1406
1405
- void dispc_ovl_set_fifo_threshold (enum omap_plane_id plane , u32 low ,
1406
- u32 high )
1407
+ void dispc_ovl_set_fifo_threshold (struct dispc_device * dispc ,
1408
+ enum omap_plane_id plane ,
1409
+ u32 low , u32 high )
1407
1410
{
1408
1411
u8 hi_start , hi_end , lo_start , lo_end ;
1409
1412
u32 unit ;
1410
1413
1411
- unit = dispc . feat -> buffer_size_unit ;
1414
+ unit = dispc -> feat -> buffer_size_unit ;
1412
1415
1413
1416
WARN_ON (low % unit != 0 );
1414
1417
WARN_ON (high % unit != 0 );
@@ -1436,12 +1439,12 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane_id plane, u32 low,
1436
1439
* large for the preload field, set the threshold to the maximum value
1437
1440
* that can be held by the preload register
1438
1441
*/
1439
- if (dispc_has_feature (FEAT_PRELOAD ) && dispc . feat -> set_max_preload &&
1442
+ if (dispc_has_feature (FEAT_PRELOAD ) && dispc -> feat -> set_max_preload &&
1440
1443
plane != OMAP_DSS_WB )
1441
1444
dispc_write_reg (DISPC_OVL_PRELOAD (plane ), min (high , 0xfffu ));
1442
1445
}
1443
1446
1444
- void dispc_enable_fifomerge (bool enable )
1447
+ void dispc_enable_fifomerge (struct dispc_device * dispc , bool enable )
1445
1448
{
1446
1449
if (!dispc_has_feature (FEAT_FIFO_MERGE )) {
1447
1450
WARN_ON (enable );
@@ -1452,15 +1455,16 @@ void dispc_enable_fifomerge(bool enable)
1452
1455
REG_FLD_MOD (DISPC_CONFIG , enable ? 1 : 0 , 14 , 14 );
1453
1456
}
1454
1457
1455
- void dispc_ovl_compute_fifo_thresholds (enum omap_plane_id plane ,
1456
- u32 * fifo_low , u32 * fifo_high , bool use_fifomerge ,
1457
- bool manual_update )
1458
+ void dispc_ovl_compute_fifo_thresholds (struct dispc_device * dispc ,
1459
+ enum omap_plane_id plane ,
1460
+ u32 * fifo_low , u32 * fifo_high ,
1461
+ bool use_fifomerge , bool manual_update )
1458
1462
{
1459
1463
/*
1460
1464
* All sizes are in bytes. Both the buffer and burst are made of
1461
1465
* buffer_units, and the fifo thresholds must be buffer_unit aligned.
1462
1466
*/
1463
- unsigned int buf_unit = dispc . feat -> buffer_size_unit ;
1467
+ unsigned int buf_unit = dispc -> feat -> buffer_size_unit ;
1464
1468
unsigned int ovl_fifo_size , total_fifo_size , burst_size ;
1465
1469
int i ;
1466
1470
@@ -1469,7 +1473,7 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane_id plane,
1469
1473
1470
1474
if (use_fifomerge ) {
1471
1475
total_fifo_size = 0 ;
1472
- for (i = 0 ; i < dispc_get_num_ovls (& dispc ); ++ i )
1476
+ for (i = 0 ; i < dispc_get_num_ovls (dispc ); ++ i )
1473
1477
total_fifo_size += dispc_ovl_get_fifo_size (i );
1474
1478
} else {
1475
1479
total_fifo_size = ovl_fifo_size ;
@@ -2665,8 +2669,9 @@ static int dispc_ovl_setup(struct dispc_device *dispc,
2665
2669
return r ;
2666
2670
}
2667
2671
2668
- int dispc_wb_setup (const struct omap_dss_writeback_info * wi ,
2669
- bool mem_to_mem , const struct videomode * vm )
2672
+ int dispc_wb_setup (struct dispc_device * dispc ,
2673
+ const struct omap_dss_writeback_info * wi ,
2674
+ bool mem_to_mem , const struct videomode * vm )
2670
2675
{
2671
2676
int r ;
2672
2677
u32 l ;
@@ -2757,15 +2762,15 @@ static void dispc_lcd_enable_signal_polarity(bool act_high)
2757
2762
REG_FLD_MOD (DISPC_CONTROL , act_high ? 1 : 0 , 29 , 29 );
2758
2763
}
2759
2764
2760
- void dispc_lcd_enable_signal (bool enable )
2765
+ void dispc_lcd_enable_signal (struct dispc_device * dispc , bool enable )
2761
2766
{
2762
2767
if (!dispc_has_feature (FEAT_LCDENABLESIGNAL ))
2763
2768
return ;
2764
2769
2765
2770
REG_FLD_MOD (DISPC_CONTROL , enable ? 1 : 0 , 28 , 28 );
2766
2771
}
2767
2772
2768
- void dispc_pck_free_enable (bool enable )
2773
+ void dispc_pck_free_enable (struct dispc_device * dispc , bool enable )
2769
2774
{
2770
2775
if (!dispc_has_feature (FEAT_PCKFREEENABLE ))
2771
2776
return ;
@@ -2904,7 +2909,7 @@ static void dispc_mgr_set_lcd_config(struct dispc_device *dispc,
2904
2909
dispc_mgr_enable_stallmode (channel , config -> stallmode );
2905
2910
dispc_mgr_enable_fifohandcheck (channel , config -> fifohandcheck );
2906
2911
2907
- dispc_mgr_set_clock_div (channel , & config -> clock_info );
2912
+ dispc_mgr_set_clock_div (dispc , channel , & config -> clock_info );
2908
2913
2909
2914
dispc_mgr_set_tft_data_lines (channel , config -> video_port_width );
2910
2915
@@ -2941,7 +2946,8 @@ static bool _dispc_mgr_pclk_ok(enum omap_channel channel,
2941
2946
return pclk <= dispc .feat -> max_tv_pclk ;
2942
2947
}
2943
2948
2944
- bool dispc_mgr_timings_ok (enum omap_channel channel , const struct videomode * vm )
2949
+ bool dispc_mgr_timings_ok (struct dispc_device * dispc , enum omap_channel channel ,
2950
+ const struct videomode * vm )
2945
2951
{
2946
2952
if (!_dispc_mgr_size_ok (vm -> hactive , vm -> vactive ))
2947
2953
return false;
@@ -3062,7 +3068,7 @@ static void dispc_mgr_set_timings(struct dispc_device *dispc,
3062
3068
3063
3069
DSSDBG ("channel %d xres %u yres %u\n" , channel , t .hactive , t .vactive );
3064
3070
3065
- if (!dispc_mgr_timings_ok (channel , & t )) {
3071
+ if (!dispc_mgr_timings_ok (dispc , channel , & t )) {
3066
3072
BUG ();
3067
3073
return ;
3068
3074
}
@@ -3195,9 +3201,9 @@ static unsigned long dispc_mgr_pclk_rate(enum omap_channel channel)
3195
3201
}
3196
3202
}
3197
3203
3198
- void dispc_set_tv_pclk (unsigned long pclk )
3204
+ void dispc_set_tv_pclk (struct dispc_device * dispc , unsigned long pclk )
3199
3205
{
3200
- dispc . tv_pclk_rate = pclk ;
3206
+ dispc -> tv_pclk_rate = pclk ;
3201
3207
}
3202
3208
3203
3209
static unsigned long dispc_core_clk_rate (void )
@@ -3249,17 +3255,18 @@ static void dispc_dump_clocks_channel(struct seq_file *s, enum omap_channel chan
3249
3255
dispc_mgr_pclk_rate (channel ), pcd );
3250
3256
}
3251
3257
3252
- void dispc_dump_clocks (struct seq_file * s )
3258
+ void dispc_dump_clocks (struct dispc_device * dispc , struct seq_file * s )
3253
3259
{
3260
+ enum dss_clk_source dispc_clk_src ;
3254
3261
int lcd ;
3255
3262
u32 l ;
3256
- enum dss_clk_source dispc_clk_src = dss_get_dispc_clk_source (dispc .dss );
3257
3263
3258
- if (dispc_runtime_get (& dispc ))
3264
+ if (dispc_runtime_get (dispc ))
3259
3265
return ;
3260
3266
3261
3267
seq_printf (s , "- DISPC -\n" );
3262
3268
3269
+ dispc_clk_src = dss_get_dispc_clk_source (dispc -> dss );
3263
3270
seq_printf (s , "dispc fclk source = %s\n" ,
3264
3271
dss_get_clk_source_name (dispc_clk_src ));
3265
3272
@@ -3281,7 +3288,7 @@ void dispc_dump_clocks(struct seq_file *s)
3281
3288
if (dispc_has_feature (FEAT_MGR_LCD3 ))
3282
3289
dispc_dump_clocks_channel (s , OMAP_DSS_CHANNEL_LCD3 );
3283
3290
3284
- dispc_runtime_put (& dispc );
3291
+ dispc_runtime_put (dispc );
3285
3292
}
3286
3293
3287
3294
static int dispc_dump_regs (struct seq_file * s , void * p )
@@ -3482,8 +3489,9 @@ static int dispc_dump_regs(struct seq_file *s, void *p)
3482
3489
}
3483
3490
3484
3491
/* calculate clock rates using dividers in cinfo */
3485
- int dispc_calc_clock_rates (unsigned long dispc_fclk_rate ,
3486
- struct dispc_clock_info * cinfo )
3492
+ int dispc_calc_clock_rates (struct dispc_device * dispc ,
3493
+ unsigned long dispc_fclk_rate ,
3494
+ struct dispc_clock_info * cinfo )
3487
3495
{
3488
3496
if (cinfo -> lck_div > 255 || cinfo -> lck_div == 0 )
3489
3497
return - EINVAL ;
@@ -3496,9 +3504,9 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
3496
3504
return 0 ;
3497
3505
}
3498
3506
3499
- bool dispc_div_calc (unsigned long dispc_freq ,
3500
- unsigned long pck_min , unsigned long pck_max ,
3501
- dispc_div_calc_func func , void * data )
3507
+ bool dispc_div_calc (struct dispc_device * dispc , unsigned long dispc_freq ,
3508
+ unsigned long pck_min , unsigned long pck_max ,
3509
+ dispc_div_calc_func func , void * data )
3502
3510
{
3503
3511
int lckd , lckd_start , lckd_stop ;
3504
3512
int pckd , pckd_start , pckd_stop ;
@@ -3514,10 +3522,10 @@ bool dispc_div_calc(unsigned long dispc_freq,
3514
3522
min_fck_per_pck = 0 ;
3515
3523
#endif
3516
3524
3517
- pckd_hw_min = dispc . feat -> min_pcd ;
3525
+ pckd_hw_min = dispc -> feat -> min_pcd ;
3518
3526
pckd_hw_max = 255 ;
3519
3527
3520
- lck_max = dss_get_max_fck_rate (dispc . dss );
3528
+ lck_max = dss_get_max_fck_rate (dispc -> dss );
3521
3529
3522
3530
pck_min = pck_min ? pck_min : 1 ;
3523
3531
pck_max = pck_max ? pck_max : ULONG_MAX ;
@@ -3556,17 +3564,19 @@ bool dispc_div_calc(unsigned long dispc_freq,
3556
3564
return false;
3557
3565
}
3558
3566
3559
- void dispc_mgr_set_clock_div (enum omap_channel channel ,
3560
- const struct dispc_clock_info * cinfo )
3567
+ void dispc_mgr_set_clock_div (struct dispc_device * dispc ,
3568
+ enum omap_channel channel ,
3569
+ const struct dispc_clock_info * cinfo )
3561
3570
{
3562
3571
DSSDBG ("lck = %lu (%u)\n" , cinfo -> lck , cinfo -> lck_div );
3563
3572
DSSDBG ("pck = %lu (%u)\n" , cinfo -> pck , cinfo -> pck_div );
3564
3573
3565
3574
dispc_mgr_set_lcd_divisor (channel , cinfo -> lck_div , cinfo -> pck_div );
3566
3575
}
3567
3576
3568
- int dispc_mgr_get_clock_div (enum omap_channel channel ,
3569
- struct dispc_clock_info * cinfo )
3577
+ int dispc_mgr_get_clock_div (struct dispc_device * dispc ,
3578
+ enum omap_channel channel ,
3579
+ struct dispc_clock_info * cinfo )
3570
3580
{
3571
3581
unsigned long fck ;
3572
3582
@@ -3604,12 +3614,12 @@ static void dispc_write_irqenable(struct dispc_device *dispc, u32 mask)
3604
3614
dispc_read_reg (DISPC_IRQENABLE );
3605
3615
}
3606
3616
3607
- void dispc_enable_sidle (void )
3617
+ void dispc_enable_sidle (struct dispc_device * dispc )
3608
3618
{
3609
3619
REG_FLD_MOD (DISPC_SYSCONFIG , 2 , 4 , 3 ); /* SIDLEMODE: smart idle */
3610
3620
}
3611
3621
3612
- void dispc_disable_sidle (void )
3622
+ void dispc_disable_sidle (struct dispc_device * dispc )
3613
3623
{
3614
3624
REG_FLD_MOD (DISPC_SYSCONFIG , 1 , 4 , 3 ); /* SIDLEMODE: no idle */
3615
3625
}
@@ -4482,7 +4492,7 @@ static void dispc_errata_i734_wa(void)
4482
4492
4483
4493
/* Set up and enable display manager for LCD1 */
4484
4494
dispc_mgr_setup (& dispc , OMAP_DSS_CHANNEL_LCD , & i734 .mgri );
4485
- dispc_calc_clock_rates (dss_get_dispc_clk_rate (dispc .dss ),
4495
+ dispc_calc_clock_rates (& dispc , dss_get_dispc_clk_rate (dispc .dss ),
4486
4496
& lcd_conf .clock_info );
4487
4497
dispc_mgr_set_lcd_config (& dispc , OMAP_DSS_CHANNEL_LCD , & lcd_conf );
4488
4498
dispc_mgr_set_timings (& dispc , OMAP_DSS_CHANNEL_LCD , & i734 .vm );
0 commit comments