29
29
#include <linux/vmalloc.h>
30
30
31
31
#include <video/sh_mobile_lcdc.h>
32
- #include <video/sh_mobile_meram.h>
33
32
34
33
#include "sh_mobile_lcdcfb.h"
35
34
@@ -217,7 +216,6 @@ struct sh_mobile_lcdc_priv {
217
216
struct notifier_block notifier ;
218
217
int started ;
219
218
int forced_fourcc ; /* 2 channel LCDC must share fourcc setting */
220
- struct sh_mobile_meram_info * meram_dev ;
221
219
};
222
220
223
221
/* -----------------------------------------------------------------------------
@@ -346,16 +344,12 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
346
344
if (priv -> dot_clk )
347
345
clk_prepare_enable (priv -> dot_clk );
348
346
pm_runtime_get_sync (priv -> dev );
349
- if (priv -> meram_dev && priv -> meram_dev -> pdev )
350
- pm_runtime_get_sync (& priv -> meram_dev -> pdev -> dev );
351
347
}
352
348
}
353
349
354
350
static void sh_mobile_lcdc_clk_off (struct sh_mobile_lcdc_priv * priv )
355
351
{
356
352
if (atomic_sub_return (1 , & priv -> hw_usecnt ) == -1 ) {
357
- if (priv -> meram_dev && priv -> meram_dev -> pdev )
358
- pm_runtime_put_sync (& priv -> meram_dev -> pdev -> dev );
359
353
pm_runtime_put (priv -> dev );
360
354
if (priv -> dot_clk )
361
355
clk_disable_unprepare (priv -> dot_clk );
@@ -1073,7 +1067,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1073
1067
1074
1068
static int sh_mobile_lcdc_start (struct sh_mobile_lcdc_priv * priv )
1075
1069
{
1076
- struct sh_mobile_meram_info * mdev = priv -> meram_dev ;
1077
1070
struct sh_mobile_lcdc_chan * ch ;
1078
1071
unsigned long tmp ;
1079
1072
int ret ;
@@ -1106,9 +1099,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1106
1099
1107
1100
/* Compute frame buffer base address and pitch for each channel. */
1108
1101
for (k = 0 ; k < ARRAY_SIZE (priv -> ch ); k ++ ) {
1109
- int pixelformat ;
1110
- void * cache ;
1111
-
1112
1102
ch = & priv -> ch [k ];
1113
1103
if (!ch -> enabled )
1114
1104
continue ;
@@ -1117,45 +1107,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1117
1107
ch -> base_addr_c = ch -> dma_handle
1118
1108
+ ch -> xres_virtual * ch -> yres_virtual ;
1119
1109
ch -> line_size = ch -> pitch ;
1120
-
1121
- /* Enable MERAM if possible. */
1122
- if (mdev == NULL || ch -> cfg -> meram_cfg == NULL )
1123
- continue ;
1124
-
1125
- /* Free the allocated MERAM cache. */
1126
- if (ch -> cache ) {
1127
- sh_mobile_meram_cache_free (mdev , ch -> cache );
1128
- ch -> cache = NULL ;
1129
- }
1130
-
1131
- switch (ch -> format -> fourcc ) {
1132
- case V4L2_PIX_FMT_NV12 :
1133
- case V4L2_PIX_FMT_NV21 :
1134
- case V4L2_PIX_FMT_NV16 :
1135
- case V4L2_PIX_FMT_NV61 :
1136
- pixelformat = SH_MOBILE_MERAM_PF_NV ;
1137
- break ;
1138
- case V4L2_PIX_FMT_NV24 :
1139
- case V4L2_PIX_FMT_NV42 :
1140
- pixelformat = SH_MOBILE_MERAM_PF_NV24 ;
1141
- break ;
1142
- case V4L2_PIX_FMT_RGB565 :
1143
- case V4L2_PIX_FMT_BGR24 :
1144
- case V4L2_PIX_FMT_BGR32 :
1145
- default :
1146
- pixelformat = SH_MOBILE_MERAM_PF_RGB ;
1147
- break ;
1148
- }
1149
-
1150
- cache = sh_mobile_meram_cache_alloc (mdev , ch -> cfg -> meram_cfg ,
1151
- ch -> pitch , ch -> yres , pixelformat ,
1152
- & ch -> line_size );
1153
- if (!IS_ERR (cache )) {
1154
- sh_mobile_meram_cache_update (mdev , cache ,
1155
- ch -> base_addr_y , ch -> base_addr_c ,
1156
- & ch -> base_addr_y , & ch -> base_addr_c );
1157
- ch -> cache = cache ;
1158
- }
1159
1110
}
1160
1111
1161
1112
for (k = 0 ; k < ARRAY_SIZE (priv -> overlays ); ++ k ) {
@@ -1223,13 +1174,6 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
1223
1174
}
1224
1175
1225
1176
sh_mobile_lcdc_display_off (ch );
1226
-
1227
- /* Free the MERAM cache. */
1228
- if (ch -> cache ) {
1229
- sh_mobile_meram_cache_free (priv -> meram_dev , ch -> cache );
1230
- ch -> cache = NULL ;
1231
- }
1232
-
1233
1177
}
1234
1178
1235
1179
/* stop the lcdc */
@@ -1851,11 +1795,6 @@ static int sh_mobile_lcdc_pan(struct fb_var_screeninfo *var,
1851
1795
base_addr_c = ch -> dma_handle + ch -> xres_virtual * ch -> yres_virtual
1852
1796
+ c_offset ;
1853
1797
1854
- if (ch -> cache )
1855
- sh_mobile_meram_cache_update (priv -> meram_dev , ch -> cache ,
1856
- base_addr_y , base_addr_c ,
1857
- & base_addr_y , & base_addr_c );
1858
-
1859
1798
ch -> base_addr_y = base_addr_y ;
1860
1799
ch -> base_addr_c = base_addr_c ;
1861
1800
ch -> pan_y_offset = y_offset ;
@@ -2718,7 +2657,7 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
2718
2657
return - ENOMEM ;
2719
2658
2720
2659
priv -> dev = & pdev -> dev ;
2721
- priv -> meram_dev = pdata -> meram_dev ;
2660
+
2722
2661
for (i = 0 ; i < ARRAY_SIZE (priv -> ch ); i ++ )
2723
2662
mutex_init (& priv -> ch [i ].open_lock );
2724
2663
platform_set_drvdata (pdev , priv );
0 commit comments