Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'fbdev-main-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux

Pull fbdev changes from Tomi Valkeinen:
"Various fbdev fixes and improvements, but nothing big"

* tag 'fbdev-main-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (38 commits)
fbdev: Make the switch from generic to native driver less alarming
Video: atmel: avoid the id of fix screen info is overwritten
video: imxfb: Add DT default contrast control register property.
video: atmel_lcdfb: ensure the hardware is initialized with the correct mode
fbdev: vesafb: add dev->remove() callback
fbdev: efifb: add dev->remove() callback
video: pxa3xx-gcu: switch to devres functions
video: pxa3xx-gcu: provide an empty .open call
video: pxa3xx-gcu: pass around struct device *
video: pxa3xx-gcu: rename some symbols
sisfb: fix 1280x720 resolution support
video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info
video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
fbdev: FB_OPENCORES should depend on HAS_DMA
OMAPDSS: convert pixel clock to common videomode style
OMAPDSS: Remove unused get_context_loss_count support
OMAPDSS: use DISPC register to detect context loss
video: da8xx-fb: Use "SIMPLE_DEV_PM_OPS" macro
video: imxfb: Convert to SIMPLE_DEV_PM_OPS
video: imxfb: Resolve mismatch between backlight/contrast
...

+709 -886
+4
Documentation/devicetree/bindings/video/fsl,imx-fb.txt
··· 15 15 - fsl,pcr: LCDC PCR value 16 16 17 17 Optional properties: 18 + - lcd-supply: Regulator for LCD supply voltage. 18 19 - fsl,dmacr: DMA Control Register value. This is optional. By default, the 19 20 register is not modified as recommended by the datasheet. 21 + - fsl,lpccr: Contrast Control Register value. This property provides the 22 + default value for the contrast control register. 23 + If that property is ommited, the register is zeroed. 20 24 - fsl,lscr1: LCDC Sharp Configuration Register value. 21 25 22 26 Example:
+51 -4
arch/arm/mach-imx/mach-mx27ads.c
··· 21 21 #include <linux/mtd/physmap.h> 22 22 #include <linux/i2c.h> 23 23 #include <linux/irq.h> 24 + 25 + #include <linux/regulator/fixed.h> 26 + #include <linux/regulator/machine.h> 27 + 24 28 #include <asm/mach-types.h> 25 29 #include <asm/mach/arch.h> 26 30 #include <asm/mach/time.h> ··· 199 195 static struct i2c_board_info mx27ads_i2c_devices[] = { 200 196 }; 201 197 202 - void lcd_power(int on) 198 + static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value) 203 199 { 204 - if (on) 200 + if (value) 205 201 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG); 206 202 else 207 203 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG); 204 + } 205 + 206 + static int vgpio_dir_out(struct gpio_chip *chip, unsigned offset, int value) 207 + { 208 + return 0; 209 + } 210 + 211 + #define MX27ADS_LCD_GPIO (6 * 32) 212 + 213 + static struct regulator_consumer_supply mx27ads_lcd_regulator_consumer = 214 + REGULATOR_SUPPLY("lcd", "imx-fb.0"); 215 + 216 + static struct regulator_init_data mx27ads_lcd_regulator_init_data = { 217 + .constraints = { 218 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 219 + }, 220 + .consumer_supplies = &mx27ads_lcd_regulator_consumer, 221 + .num_consumer_supplies = 1, 222 + }; 223 + 224 + static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = { 225 + .supply_name = "LCD", 226 + .microvolts = 3300000, 227 + .gpio = MX27ADS_LCD_GPIO, 228 + .init_data = &mx27ads_lcd_regulator_init_data, 229 + }; 230 + 231 + static void __init mx27ads_regulator_init(void) 232 + { 233 + struct gpio_chip *vchip; 234 + 235 + vchip = kzalloc(sizeof(*vchip), GFP_KERNEL); 236 + vchip->owner = THIS_MODULE; 237 + vchip->label = "LCD"; 238 + vchip->base = MX27ADS_LCD_GPIO; 239 + vchip->ngpio = 1; 240 + vchip->direction_output = vgpio_dir_out; 241 + vchip->set = vgpio_set; 242 + gpiochip_add(vchip); 243 + 244 + platform_device_register_data(&platform_bus, "reg-fixed-voltage", 245 + PLATFORM_DEVID_AUTO, 246 + &mx27ads_lcd_regulator_pdata, 247 + sizeof(mx27ads_lcd_regulator_pdata)); 208 248 } 209 249 210 250 static struct imx_fb_videomode mx27ads_modes[] = { ··· 287 239 .pwmr = 0x00A903FF, 288 240 .lscr1 = 0x00120300, 289 241 .dmacr = 0x00020010, 290 - 291 - .lcd_power = lcd_power, 292 242 }; 293 243 294 244 static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, ··· 350 304 i2c_register_board_info(1, mx27ads_i2c_devices, 351 305 ARRAY_SIZE(mx27ads_i2c_devices)); 352 306 imx27_add_imx_i2c(1, &mx27ads_i2c1_data); 307 + mx27ads_regulator_init(); 353 308 imx27_add_imx_fb(&mx27ads_fb_data); 354 309 imx27_add_mxc_mmc(0, &sdhc1_pdata); 355 310 imx27_add_mxc_mmc(1, &sdhc2_pdata);
-1
arch/arm/mach-omap2/display.c
··· 301 301 board_data->version = ver; 302 302 board_data->dsi_enable_pads = omap_dsi_enable_pads; 303 303 board_data->dsi_disable_pads = omap_dsi_disable_pads; 304 - board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; 305 304 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput; 306 305 307 306 omap_display_device.dev.platform_data = board_data;
+3 -3
drivers/gpu/drm/omapdrm/omap_connector.c
··· 37 37 void copy_timings_omap_to_drm(struct drm_display_mode *mode, 38 38 struct omap_video_timings *timings) 39 39 { 40 - mode->clock = timings->pixel_clock; 40 + mode->clock = timings->pixelclock / 1000; 41 41 42 42 mode->hdisplay = timings->x_res; 43 43 mode->hsync_start = mode->hdisplay + timings->hfp; ··· 68 68 void copy_timings_drm_to_omap(struct omap_video_timings *timings, 69 69 struct drm_display_mode *mode) 70 70 { 71 - timings->pixel_clock = mode->clock; 71 + timings->pixelclock = mode->clock * 1000; 72 72 73 73 timings->x_res = mode->hdisplay; 74 74 timings->hfp = mode->hsync_start - mode->hdisplay; ··· 220 220 if (!r) { 221 221 /* check if vrefresh is still valid */ 222 222 new_mode = drm_mode_duplicate(dev, mode); 223 - new_mode->clock = timings.pixel_clock; 223 + new_mode->clock = timings.pixelclock / 1000; 224 224 new_mode->vrefresh = 0; 225 225 if (mode->vrefresh == drm_mode_vrefresh(new_mode)) 226 226 ret = MODE_OK;
+1 -1
drivers/video/Kconfig
··· 967 967 968 968 config FB_OPENCORES 969 969 tristate "OpenCores VGA/LCD core 2.0 framebuffer support" 970 - depends on FB 970 + depends on FB && HAS_DMA 971 971 select FB_CFB_FILLRECT 972 972 select FB_CFB_COPYAREA 973 973 select FB_CFB_IMAGEBLIT
+7 -1
drivers/video/atmel_lcdfb.c
··· 1190 1190 if (!sinfo->config) 1191 1191 goto free_info; 1192 1192 1193 - strcpy(info->fix.id, sinfo->pdev->name); 1194 1193 info->flags = ATMEL_LCDFB_FBINFO_DEFAULT; 1195 1194 info->pseudo_palette = sinfo->pseudo_palette; 1196 1195 info->fbops = &atmel_lcdfb_ops; 1197 1196 1198 1197 info->fix = atmel_lcdfb_fix; 1198 + strcpy(info->fix.id, sinfo->pdev->name); 1199 1199 1200 1200 /* Enable LCDC Clocks */ 1201 1201 sinfo->bus_clk = clk_get(dev, "hclk"); ··· 1295 1295 ret = atmel_lcdfb_init_fbinfo(sinfo); 1296 1296 if (ret < 0) { 1297 1297 dev_err(dev, "init fbinfo failed: %d\n", ret); 1298 + goto unregister_irqs; 1299 + } 1300 + 1301 + ret = atmel_lcdfb_set_par(info); 1302 + if (ret < 0) { 1303 + dev_err(dev, "set par failed: %d\n", ret); 1298 1304 goto unregister_irqs; 1299 1305 } 1300 1306
+4 -3
drivers/video/aty/atyfb_base.c
··· 862 862 h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1; 863 863 v_sync_pol = sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1; 864 864 865 - if ((xres > 1600) || (yres > 1200)) { 866 - FAIL("MACH64 chips are designed for max 1600x1200\n" 865 + if ((xres > 1920) || (yres > 1200)) { 866 + FAIL("MACH64 chips are designed for max 1920x1200\n" 867 867 "select another resolution."); 868 868 } 869 869 h_sync_strt = h_disp + var->right_margin; ··· 2653 2653 FBINFO_HWACCEL_IMAGEBLIT | 2654 2654 FBINFO_HWACCEL_FILLRECT | 2655 2655 FBINFO_HWACCEL_COPYAREA | 2656 - FBINFO_HWACCEL_YPAN; 2656 + FBINFO_HWACCEL_YPAN | 2657 + FBINFO_READS_FAST; 2657 2658 2658 2659 #ifdef CONFIG_PMAC_BACKLIGHT 2659 2660 if (M64_HAS(G3_PB_1_1) && of_machine_is_compatible("PowerBook1,1")) {
+2 -1
drivers/video/aty/mach64_accel.c
··· 4 4 */ 5 5 6 6 #include <linux/delay.h> 7 + #include <asm/unaligned.h> 7 8 #include <linux/fb.h> 8 9 #include <video/mach64.h> 9 10 #include "atyfb.h" ··· 420 419 u32 *pbitmap, dwords = (src_bytes + 3) / 4; 421 420 for (pbitmap = (u32*)(image->data); dwords; dwords--, pbitmap++) { 422 421 wait_for_fifo(1, par); 423 - aty_st_le32(HOST_DATA0, le32_to_cpup(pbitmap), par); 422 + aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par); 424 423 } 425 424 } 426 425
+16 -6
drivers/video/aty/mach64_cursor.c
··· 5 5 #include <linux/fb.h> 6 6 #include <linux/init.h> 7 7 #include <linux/string.h> 8 + #include "../fb_draw.h" 8 9 9 10 #include <asm/io.h> 10 11 ··· 158 157 159 158 for (i = 0; i < height; i++) { 160 159 for (j = 0; j < width; j++) { 160 + u16 l = 0xaaaa; 161 161 b = *src++; 162 162 m = *msk++; 163 163 switch (cursor->rop) { 164 164 case ROP_XOR: 165 165 // Upper 4 bits of mask data 166 - fb_writeb(cursor_bits_lookup[(b ^ m) >> 4], dst++); 166 + l = cursor_bits_lookup[(b ^ m) >> 4] | 167 167 // Lower 4 bits of mask 168 - fb_writeb(cursor_bits_lookup[(b ^ m) & 0x0f], 169 - dst++); 168 + (cursor_bits_lookup[(b ^ m) & 0x0f] << 8); 170 169 break; 171 170 case ROP_COPY: 172 171 // Upper 4 bits of mask data 173 - fb_writeb(cursor_bits_lookup[(b & m) >> 4], dst++); 172 + l = cursor_bits_lookup[(b & m) >> 4] | 174 173 // Lower 4 bits of mask 175 - fb_writeb(cursor_bits_lookup[(b & m) & 0x0f], 176 - dst++); 174 + (cursor_bits_lookup[(b & m) & 0x0f] << 8); 177 175 break; 178 176 } 177 + /* 178 + * If cursor size is not a multiple of 8 characters 179 + * we must pad it with transparent pattern (0xaaaa). 180 + */ 181 + if ((j + 1) * 8 > cursor->image.width) { 182 + l = comp(l, 0xaaaa, 183 + (1 << ((cursor->image.width & 7) * 2)) - 1); 184 + } 185 + fb_writeb(l & 0xff, dst++); 186 + fb_writeb(l >> 8, dst++); 179 187 } 180 188 dst += offset; 181 189 }
+78 -75
drivers/video/cfbcopyarea.c
··· 43 43 */ 44 44 45 45 static void 46 - bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, 47 - const unsigned long __iomem *src, int src_idx, int bits, 46 + bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, 47 + const unsigned long __iomem *src, unsigned src_idx, int bits, 48 48 unsigned n, u32 bswapmask) 49 49 { 50 50 unsigned long first, last; 51 51 int const shift = dst_idx-src_idx; 52 - int left, right; 52 + 53 + #if 0 54 + /* 55 + * If you suspect bug in this function, compare it with this simple 56 + * memmove implementation. 57 + */ 58 + fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, 59 + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); 60 + return; 61 + #endif 53 62 54 63 first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); 55 64 last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); ··· 107 98 unsigned long d0, d1; 108 99 int m; 109 100 110 - right = shift & (bits - 1); 111 - left = -shift & (bits - 1); 112 - bswapmask &= shift; 101 + int const left = shift & (bits - 1); 102 + int const right = -shift & (bits - 1); 113 103 114 104 if (dst_idx+n <= bits) { 115 105 // Single destination word ··· 118 110 d0 = fb_rev_pixels_in_long(d0, bswapmask); 119 111 if (shift > 0) { 120 112 // Single source word 121 - d0 >>= right; 113 + d0 <<= left; 122 114 } else if (src_idx+n <= bits) { 123 115 // Single source word 124 - d0 <<= left; 116 + d0 >>= right; 125 117 } else { 126 118 // 2 source words 127 119 d1 = FB_READL(src + 1); 128 120 d1 = fb_rev_pixels_in_long(d1, bswapmask); 129 - d0 = d0<<left | d1>>right; 121 + d0 = d0 >> right | d1 << left; 130 122 } 131 123 d0 = fb_rev_pixels_in_long(d0, bswapmask); 132 124 FB_WRITEL(comp(d0, FB_READL(dst), first), dst); ··· 143 135 if (shift > 0) { 144 136 // Single source word 145 137 d1 = d0; 146 - d0 >>= right; 147 - dst++; 138 + d0 <<= left; 148 139 n -= bits - dst_idx; 149 140 } else { 150 141 // 2 source words 151 142 d1 = FB_READL(src++); 152 143 d1 = fb_rev_pixels_in_long(d1, bswapmask); 153 144 154 - d0 = d0<<left | d1>>right; 155 - dst++; 145 + d0 = d0 >> right | d1 << left; 156 146 n -= bits - dst_idx; 157 147 } 158 148 d0 = fb_rev_pixels_in_long(d0, bswapmask); 159 149 FB_WRITEL(comp(d0, FB_READL(dst), first), dst); 160 150 d0 = d1; 151 + dst++; 161 152 162 153 // Main chunk 163 154 m = n % bits; 164 155 n /= bits; 165 156 while ((n >= 4) && !bswapmask) { 166 157 d1 = FB_READL(src++); 167 - FB_WRITEL(d0 << left | d1 >> right, dst++); 158 + FB_WRITEL(d0 >> right | d1 << left, dst++); 168 159 d0 = d1; 169 160 d1 = FB_READL(src++); 170 - FB_WRITEL(d0 << left | d1 >> right, dst++); 161 + FB_WRITEL(d0 >> right | d1 << left, dst++); 171 162 d0 = d1; 172 163 d1 = FB_READL(src++); 173 - FB_WRITEL(d0 << left | d1 >> right, dst++); 164 + FB_WRITEL(d0 >> right | d1 << left, dst++); 174 165 d0 = d1; 175 166 d1 = FB_READL(src++); 176 - FB_WRITEL(d0 << left | d1 >> right, dst++); 167 + FB_WRITEL(d0 >> right | d1 << left, dst++); 177 168 d0 = d1; 178 169 n -= 4; 179 170 } 180 171 while (n--) { 181 172 d1 = FB_READL(src++); 182 173 d1 = fb_rev_pixels_in_long(d1, bswapmask); 183 - d0 = d0 << left | d1 >> right; 174 + d0 = d0 >> right | d1 << left; 184 175 d0 = fb_rev_pixels_in_long(d0, bswapmask); 185 176 FB_WRITEL(d0, dst++); 186 177 d0 = d1; 187 178 } 188 179 189 180 // Trailing bits 190 - if (last) { 191 - if (m <= right) { 181 + if (m) { 182 + if (m <= bits - right) { 192 183 // Single source word 193 - d0 <<= left; 184 + d0 >>= right; 194 185 } else { 195 186 // 2 source words 196 187 d1 = FB_READL(src); 197 188 d1 = fb_rev_pixels_in_long(d1, 198 189 bswapmask); 199 - d0 = d0<<left | d1>>right; 190 + d0 = d0 >> right | d1 << left; 200 191 } 201 192 d0 = fb_rev_pixels_in_long(d0, bswapmask); 202 193 FB_WRITEL(comp(d0, FB_READL(dst), last), dst); ··· 209 202 */ 210 203 211 204 static void 212 - bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, 213 - const unsigned long __iomem *src, int src_idx, int bits, 205 + bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, 206 + const unsigned long __iomem *src, unsigned src_idx, int bits, 214 207 unsigned n, u32 bswapmask) 215 208 { 216 209 unsigned long first, last; 217 210 int shift; 218 211 219 - dst += (n-1)/bits; 220 - src += (n-1)/bits; 221 - if ((n-1) % bits) { 222 - dst_idx += (n-1) % bits; 223 - dst += dst_idx >> (ffs(bits) - 1); 224 - dst_idx &= bits - 1; 225 - src_idx += (n-1) % bits; 226 - src += src_idx >> (ffs(bits) - 1); 227 - src_idx &= bits - 1; 228 - } 212 + #if 0 213 + /* 214 + * If you suspect bug in this function, compare it with this simple 215 + * memmove implementation. 216 + */ 217 + fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, 218 + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); 219 + return; 220 + #endif 221 + 222 + dst += (dst_idx + n - 1) / bits; 223 + src += (src_idx + n - 1) / bits; 224 + dst_idx = (dst_idx + n - 1) % bits; 225 + src_idx = (src_idx + n - 1) % bits; 229 226 230 227 shift = dst_idx-src_idx; 231 228 232 - first = fb_shifted_pixels_mask_long(p, bits - 1 - dst_idx, bswapmask); 233 - last = ~fb_shifted_pixels_mask_long(p, bits - 1 - ((dst_idx-n) % bits), 234 - bswapmask); 229 + first = ~fb_shifted_pixels_mask_long(p, (dst_idx + 1) % bits, bswapmask); 230 + last = fb_shifted_pixels_mask_long(p, (bits + dst_idx + 1 - n) % bits, bswapmask); 235 231 236 232 if (!shift) { 237 233 // Same alignment for source and dest 238 234 239 235 if ((unsigned long)dst_idx+1 >= n) { 240 236 // Single word 241 - if (last) 242 - first &= last; 243 - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); 237 + if (first) 238 + last &= first; 239 + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); 244 240 } else { 245 241 // Multiple destination words 246 242 247 243 // Leading bits 248 - if (first != ~0UL) { 244 + if (first) { 249 245 FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); 250 246 dst--; 251 247 src--; ··· 272 262 FB_WRITEL(FB_READL(src--), dst--); 273 263 274 264 // Trailing bits 275 - if (last) 265 + if (last != -1UL) 276 266 FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); 277 267 } 278 268 } else { ··· 280 270 unsigned long d0, d1; 281 271 int m; 282 272 283 - int const left = -shift & (bits-1); 284 - int const right = shift & (bits-1); 285 - bswapmask &= shift; 273 + int const left = shift & (bits-1); 274 + int const right = -shift & (bits-1); 286 275 287 276 if ((unsigned long)dst_idx+1 >= n) { 288 277 // Single destination word 289 - if (last) 290 - first &= last; 278 + if (first) 279 + last &= first; 291 280 d0 = FB_READL(src); 292 281 if (shift < 0) { 293 282 // Single source word 294 - d0 <<= left; 283 + d0 >>= right; 295 284 } else if (1+(unsigned long)src_idx >= n) { 296 285 // Single source word 297 - d0 >>= right; 286 + d0 <<= left; 298 287 } else { 299 288 // 2 source words 300 289 d1 = FB_READL(src - 1); 301 290 d1 = fb_rev_pixels_in_long(d1, bswapmask); 302 - d0 = d0>>right | d1<<left; 291 + d0 = d0 << left | d1 >> right; 303 292 } 304 293 d0 = fb_rev_pixels_in_long(d0, bswapmask); 305 - FB_WRITEL(comp(d0, FB_READL(dst), first), dst); 294 + FB_WRITEL(comp(d0, FB_READL(dst), last), dst); 306 295 } else { 307 296 // Multiple destination words 308 297 /** We must always remember the last value read, because in case ··· 316 307 if (shift < 0) { 317 308 // Single source word 318 309 d1 = d0; 319 - d0 <<= left; 310 + d0 >>= right; 320 311 } else { 321 312 // 2 source words 322 313 d1 = FB_READL(src--); 323 314 d1 = fb_rev_pixels_in_long(d1, bswapmask); 324 - d0 = d0>>right | d1<<left; 315 + d0 = d0 << left | d1 >> right; 325 316 } 326 317 d0 = fb_rev_pixels_in_long(d0, bswapmask); 327 318 FB_WRITEL(comp(d0, FB_READL(dst), first), dst); ··· 334 325 n /= bits; 335 326 while ((n >= 4) && !bswapmask) { 336 327 d1 = FB_READL(src--); 337 - FB_WRITEL(d0 >> right | d1 << left, dst--); 328 + FB_WRITEL(d0 << left | d1 >> right, dst--); 338 329 d0 = d1; 339 330 d1 = FB_READL(src--); 340 - FB_WRITEL(d0 >> right | d1 << left, dst--); 331 + FB_WRITEL(d0 << left | d1 >> right, dst--); 341 332 d0 = d1; 342 333 d1 = FB_READL(src--); 343 - FB_WRITEL(d0 >> right | d1 << left, dst--); 334 + FB_WRITEL(d0 << left | d1 >> right, dst--); 344 335 d0 = d1; 345 336 d1 = FB_READL(src--); 346 - FB_WRITEL(d0 >> right | d1 << left, dst--); 337 + FB_WRITEL(d0 << left | d1 >> right, dst--); 347 338 d0 = d1; 348 339 n -= 4; 349 340 } 350 341 while (n--) { 351 342 d1 = FB_READL(src--); 352 343 d1 = fb_rev_pixels_in_long(d1, bswapmask); 353 - d0 = d0 >> right | d1 << left; 344 + d0 = d0 << left | d1 >> right; 354 345 d0 = fb_rev_pixels_in_long(d0, bswapmask); 355 346 FB_WRITEL(d0, dst--); 356 347 d0 = d1; 357 348 } 358 349 359 350 // Trailing bits 360 - if (last) { 361 - if (m <= left) { 351 + if (m) { 352 + if (m <= bits - left) { 362 353 // Single source word 363 - d0 >>= right; 354 + d0 <<= left; 364 355 } else { 365 356 // 2 source words 366 357 d1 = FB_READL(src); 367 358 d1 = fb_rev_pixels_in_long(d1, 368 359 bswapmask); 369 - d0 = d0>>right | d1<<left; 360 + d0 = d0 << left | d1 >> right; 370 361 } 371 362 d0 = fb_rev_pixels_in_long(d0, bswapmask); 372 363 FB_WRITEL(comp(d0, FB_READL(dst), last), dst); ··· 380 371 u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; 381 372 u32 height = area->height, width = area->width; 382 373 unsigned long const bits_per_line = p->fix.line_length*8u; 383 - unsigned long __iomem *dst = NULL, *src = NULL; 374 + unsigned long __iomem *base = NULL; 384 375 int bits = BITS_PER_LONG, bytes = bits >> 3; 385 - int dst_idx = 0, src_idx = 0, rev_copy = 0; 376 + unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; 386 377 u32 bswapmask = fb_compute_bswapmask(p); 387 378 388 379 if (p->state != FBINFO_STATE_RUNNING) ··· 398 389 399 390 // split the base of the framebuffer into a long-aligned address and the 400 391 // index of the first bit 401 - dst = src = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); 392 + base = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); 402 393 dst_idx = src_idx = 8*((unsigned long)p->screen_base & (bytes-1)); 403 394 // add offset of source and target area 404 395 dst_idx += dy*bits_per_line + dx*p->var.bits_per_pixel; ··· 411 402 while (height--) { 412 403 dst_idx -= bits_per_line; 413 404 src_idx -= bits_per_line; 414 - dst += dst_idx >> (ffs(bits) - 1); 415 - dst_idx &= (bytes - 1); 416 - src += src_idx >> (ffs(bits) - 1); 417 - src_idx &= (bytes - 1); 418 - bitcpy_rev(p, dst, dst_idx, src, src_idx, bits, 405 + bitcpy_rev(p, base + (dst_idx / bits), dst_idx % bits, 406 + base + (src_idx / bits), src_idx % bits, bits, 419 407 width*p->var.bits_per_pixel, bswapmask); 420 408 } 421 409 } else { 422 410 while (height--) { 423 - dst += dst_idx >> (ffs(bits) - 1); 424 - dst_idx &= (bytes - 1); 425 - src += src_idx >> (ffs(bits) - 1); 426 - src_idx &= (bytes - 1); 427 - bitcpy(p, dst, dst_idx, src, src_idx, bits, 411 + bitcpy(p, base + (dst_idx / bits), dst_idx % bits, 412 + base + (src_idx / bits), src_idx % bits, bits, 428 413 width*p->var.bits_per_pixel, bswapmask); 429 414 dst_idx += bits_per_line; 430 415 src_idx += bits_per_line;
+25 -2
drivers/video/console/fbcon.c
··· 759 759 newinfo in an undefined state. Thus, a call to 760 760 fb_set_par() may be needed for the newinfo. 761 761 */ 762 - if (newinfo->fbops->fb_set_par) { 762 + if (newinfo && newinfo->fbops->fb_set_par) { 763 763 ret = newinfo->fbops->fb_set_par(newinfo); 764 764 765 765 if (ret) ··· 3028 3028 if (con2fb_map[i] == idx) 3029 3029 set_con2fb_map(i, new_idx, 0); 3030 3030 } 3031 - } else 3031 + } else { 3032 + struct fb_info *info = registered_fb[idx]; 3033 + 3034 + /* This is sort of like set_con2fb_map, except it maps 3035 + * the consoles to no device and then releases the 3036 + * oldinfo to free memory and cancel the cursor blink 3037 + * timer. I can imagine this just becoming part of 3038 + * set_con2fb_map where new_idx is -1 3039 + */ 3040 + for (i = first_fb_vc; i <= last_fb_vc; i++) { 3041 + if (con2fb_map[i] == idx) { 3042 + con2fb_map[i] = -1; 3043 + if (!search_fb_in_map(idx)) { 3044 + ret = con2fb_release_oldinfo(vc_cons[i].d, 3045 + info, NULL, i, 3046 + idx, 0); 3047 + if (ret) { 3048 + con2fb_map[i] = idx; 3049 + return ret; 3050 + } 3051 + } 3052 + } 3053 + } 3032 3054 ret = fbcon_unbind(); 3055 + } 3033 3056 3034 3057 return ret; 3035 3058 }
+10 -12
drivers/video/da8xx-fb.c
··· 1546 1546 return ret; 1547 1547 } 1548 1548 1549 - #ifdef CONFIG_PM 1549 + #ifdef CONFIG_PM_SLEEP 1550 1550 static struct lcdc_context { 1551 1551 u32 clk_enable; 1552 1552 u32 ctrl; ··· 1610 1610 return; 1611 1611 } 1612 1612 1613 - static int fb_suspend(struct platform_device *dev, pm_message_t state) 1613 + static int fb_suspend(struct device *dev) 1614 1614 { 1615 - struct fb_info *info = platform_get_drvdata(dev); 1615 + struct fb_info *info = dev_get_drvdata(dev); 1616 1616 struct da8xx_fb_par *par = info->par; 1617 1617 1618 1618 console_lock(); ··· 1622 1622 fb_set_suspend(info, 1); 1623 1623 lcd_disable_raster(DA8XX_FRAME_WAIT); 1624 1624 lcd_context_save(); 1625 - pm_runtime_put_sync(&dev->dev); 1625 + pm_runtime_put_sync(dev); 1626 1626 console_unlock(); 1627 1627 1628 1628 return 0; 1629 1629 } 1630 - static int fb_resume(struct platform_device *dev) 1630 + static int fb_resume(struct device *dev) 1631 1631 { 1632 - struct fb_info *info = platform_get_drvdata(dev); 1632 + struct fb_info *info = dev_get_drvdata(dev); 1633 1633 struct da8xx_fb_par *par = info->par; 1634 1634 1635 1635 console_lock(); 1636 - pm_runtime_get_sync(&dev->dev); 1636 + pm_runtime_get_sync(dev); 1637 1637 lcd_context_restore(); 1638 1638 if (par->blank == FB_BLANK_UNBLANK) { 1639 1639 lcd_enable_raster(); ··· 1647 1647 1648 1648 return 0; 1649 1649 } 1650 - #else 1651 - #define fb_suspend NULL 1652 - #define fb_resume NULL 1653 1650 #endif 1651 + 1652 + static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume); 1654 1653 1655 1654 static struct platform_driver da8xx_fb_driver = { 1656 1655 .probe = fb_probe, 1657 1656 .remove = fb_remove, 1658 - .suspend = fb_suspend, 1659 - .resume = fb_resume, 1660 1657 .driver = { 1661 1658 .name = DRIVER_NAME, 1662 1659 .owner = THIS_MODULE, 1660 + .pm = &fb_pm_ops, 1663 1661 }, 1664 1662 }; 1665 1663 module_platform_driver(da8xx_fb_driver);
+12 -1
drivers/video/efifb.c
··· 73 73 release_mem_region(info->apertures->ranges[0].base, 74 74 info->apertures->ranges[0].size); 75 75 fb_dealloc_cmap(&info->cmap); 76 - framebuffer_release(info); 77 76 } 78 77 79 78 static struct fb_ops efifb_ops = { ··· 243 244 err = -ENOMEM; 244 245 goto err_release_mem; 245 246 } 247 + platform_set_drvdata(dev, info); 246 248 info->pseudo_palette = info->par; 247 249 info->par = NULL; 248 250 ··· 337 337 return err; 338 338 } 339 339 340 + static int efifb_remove(struct platform_device *pdev) 341 + { 342 + struct fb_info *info = platform_get_drvdata(pdev); 343 + 344 + unregister_framebuffer(info); 345 + framebuffer_release(info); 346 + 347 + return 0; 348 + } 349 + 340 350 static struct platform_driver efifb_driver = { 341 351 .driver = { 342 352 .name = "efi-framebuffer", 343 353 .owner = THIS_MODULE, 344 354 }, 345 355 .probe = efifb_probe, 356 + .remove = efifb_remove, 346 357 }; 347 358 348 359 module_platform_driver(efifb_driver);
+1 -1
drivers/video/exynos/Kconfig
··· 31 31 32 32 config EXYNOS_DP 33 33 bool "EXYNOS DP driver support" 34 - depends on OF && ARCH_EXYNOS 34 + depends on ARCH_EXYNOS 35 35 default n 36 36 help 37 37 This enables support for DP device.
+4 -9
drivers/video/exynos/s6e8ax0.c
··· 794 794 return ret; 795 795 } 796 796 797 - lcd->ld = lcd_device_register("s6e8ax0", lcd->dev, lcd, 797 + lcd->ld = devm_lcd_device_register(lcd->dev, "s6e8ax0", lcd->dev, lcd, 798 798 &s6e8ax0_lcd_ops); 799 799 if (IS_ERR(lcd->ld)) { 800 800 dev_err(lcd->dev, "failed to register lcd ops.\n"); 801 801 return PTR_ERR(lcd->ld); 802 802 } 803 803 804 - lcd->bd = backlight_device_register("s6e8ax0-bl", lcd->dev, lcd, 805 - &s6e8ax0_backlight_ops, NULL); 804 + lcd->bd = devm_backlight_device_register(lcd->dev, "s6e8ax0-bl", 805 + lcd->dev, lcd, &s6e8ax0_backlight_ops, NULL); 806 806 if (IS_ERR(lcd->bd)) { 807 807 dev_err(lcd->dev, "failed to register backlight ops.\n"); 808 - ret = PTR_ERR(lcd->bd); 809 - goto err_backlight_register; 808 + return PTR_ERR(lcd->bd); 810 809 } 811 810 812 811 lcd->bd->props.max_brightness = MAX_BRIGHTNESS; ··· 833 834 dev_dbg(lcd->dev, "probed s6e8ax0 panel driver.\n"); 834 835 835 836 return 0; 836 - 837 - err_backlight_register: 838 - lcd_device_unregister(lcd->ld); 839 - return ret; 840 837 } 841 838 842 839 #ifdef CONFIG_PM
+1 -2
drivers/video/fbmem.c
··· 1596 1596 (primary && gen_aper && gen_aper->count && 1597 1597 gen_aper->ranges[0].base == VGA_FB_PHYS)) { 1598 1598 1599 - printk(KERN_INFO "fb: conflicting fb hw usage " 1600 - "%s vs %s - removing generic driver\n", 1599 + printk(KERN_INFO "fb: switching to %s from %s\n", 1601 1600 name, registered_fb[i]->fix.id); 1602 1601 ret = do_unregister_framebuffer(registered_fb[i]); 1603 1602 if (ret)
+156 -224
drivers/video/imxfb.c
··· 30 30 #include <linux/platform_device.h> 31 31 #include <linux/dma-mapping.h> 32 32 #include <linux/io.h> 33 + #include <linux/lcd.h> 33 34 #include <linux/math64.h> 34 35 #include <linux/of.h> 35 36 #include <linux/of_device.h> 37 + 38 + #include <linux/regulator/consumer.h> 36 39 37 40 #include <video/of_display_timing.h> 38 41 #include <video/of_videomode.h> ··· 47 44 * Complain if VAR is out of range. 48 45 */ 49 46 #define DEBUG_VAR 1 50 - 51 - #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \ 52 - (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) && \ 53 - defined(CONFIG_FB_IMX_MODULE)) 54 - #define PWMR_BACKLIGHT_AVAILABLE 55 - #endif 56 47 57 48 #define DRIVER_NAME "imx-fb" 58 49 ··· 150 153 * the framebuffer memory region to. 151 154 */ 152 155 dma_addr_t map_dma; 153 - u_char *map_cpu; 154 156 u_int map_size; 155 157 156 - u_char *screen_cpu; 157 - dma_addr_t screen_dma; 158 158 u_int palette_size; 159 159 160 160 dma_addr_t dbar1; ··· 161 167 u_int pwmr; 162 168 u_int lscr1; 163 169 u_int dmacr; 164 - u_int cmap_inverse:1, 165 - cmap_static:1, 166 - unused:30; 170 + bool cmap_inverse; 171 + bool cmap_static; 167 172 168 173 struct imx_fb_videomode *mode; 169 174 int num_modes; 170 - #ifdef PWMR_BACKLIGHT_AVAILABLE 171 - struct backlight_device *bl; 172 - #endif 173 175 174 - void (*lcd_power)(int); 175 - void (*backlight_power)(int); 176 + struct regulator *lcd_pwr; 176 177 }; 177 178 178 179 static struct platform_device_id imxfb_devtype[] = { ··· 473 484 return 0; 474 485 } 475 486 476 - #ifdef PWMR_BACKLIGHT_AVAILABLE 477 - static int imxfb_bl_get_brightness(struct backlight_device *bl) 478 - { 479 - struct imxfb_info *fbi = bl_get_data(bl); 480 - 481 - return readl(fbi->regs + LCDC_PWMR) & 0xFF; 482 - } 483 - 484 - static int imxfb_bl_update_status(struct backlight_device *bl) 485 - { 486 - struct imxfb_info *fbi = bl_get_data(bl); 487 - int brightness = bl->props.brightness; 488 - 489 - if (!fbi->pwmr) 490 - return 0; 491 - 492 - if (bl->props.power != FB_BLANK_UNBLANK) 493 - brightness = 0; 494 - if (bl->props.fb_blank != FB_BLANK_UNBLANK) 495 - brightness = 0; 496 - 497 - fbi->pwmr = (fbi->pwmr & ~0xFF) | brightness; 498 - 499 - if (bl->props.fb_blank != FB_BLANK_UNBLANK) { 500 - clk_prepare_enable(fbi->clk_ipg); 501 - clk_prepare_enable(fbi->clk_ahb); 502 - clk_prepare_enable(fbi->clk_per); 503 - } 504 - writel(fbi->pwmr, fbi->regs + LCDC_PWMR); 505 - if (bl->props.fb_blank != FB_BLANK_UNBLANK) { 506 - clk_disable_unprepare(fbi->clk_per); 507 - clk_disable_unprepare(fbi->clk_ahb); 508 - clk_disable_unprepare(fbi->clk_ipg); 509 - } 510 - 511 - return 0; 512 - } 513 - 514 - static const struct backlight_ops imxfb_lcdc_bl_ops = { 515 - .update_status = imxfb_bl_update_status, 516 - .get_brightness = imxfb_bl_get_brightness, 517 - }; 518 - 519 - static void imxfb_init_backlight(struct imxfb_info *fbi) 520 - { 521 - struct backlight_properties props; 522 - struct backlight_device *bl; 523 - 524 - if (fbi->bl) 525 - return; 526 - 527 - memset(&props, 0, sizeof(struct backlight_properties)); 528 - props.max_brightness = 0xff; 529 - props.type = BACKLIGHT_RAW; 530 - writel(fbi->pwmr, fbi->regs + LCDC_PWMR); 531 - 532 - bl = backlight_device_register("imxfb-bl", &fbi->pdev->dev, fbi, 533 - &imxfb_lcdc_bl_ops, &props); 534 - if (IS_ERR(bl)) { 535 - dev_err(&fbi->pdev->dev, "error %ld on backlight register\n", 536 - PTR_ERR(bl)); 537 - return; 538 - } 539 - 540 - fbi->bl = bl; 541 - bl->props.power = FB_BLANK_UNBLANK; 542 - bl->props.fb_blank = FB_BLANK_UNBLANK; 543 - bl->props.brightness = imxfb_bl_get_brightness(bl); 544 - } 545 - 546 - static void imxfb_exit_backlight(struct imxfb_info *fbi) 547 - { 548 - if (fbi->bl) 549 - backlight_device_unregister(fbi->bl); 550 - } 551 - #endif 552 - 553 487 static void imxfb_enable_controller(struct imxfb_info *fbi) 554 488 { 555 489 ··· 481 569 482 570 pr_debug("Enabling LCD controller\n"); 483 571 484 - writel(fbi->screen_dma, fbi->regs + LCDC_SSA); 572 + writel(fbi->map_dma, fbi->regs + LCDC_SSA); 485 573 486 574 /* panning offset 0 (0 pixel offset) */ 487 575 writel(0x00000000, fbi->regs + LCDC_POS); ··· 500 588 clk_prepare_enable(fbi->clk_ahb); 501 589 clk_prepare_enable(fbi->clk_per); 502 590 fbi->enabled = true; 503 - 504 - if (fbi->backlight_power) 505 - fbi->backlight_power(1); 506 - if (fbi->lcd_power) 507 - fbi->lcd_power(1); 508 591 } 509 592 510 593 static void imxfb_disable_controller(struct imxfb_info *fbi) ··· 508 601 return; 509 602 510 603 pr_debug("Disabling LCD controller\n"); 511 - 512 - if (fbi->backlight_power) 513 - fbi->backlight_power(0); 514 - if (fbi->lcd_power) 515 - fbi->lcd_power(0); 516 604 517 605 clk_disable_unprepare(fbi->clk_per); 518 606 clk_disable_unprepare(fbi->clk_ipg); ··· 611 709 fbi->regs + LCDC_SIZE); 612 710 613 711 writel(fbi->pcr, fbi->regs + LCDC_PCR); 614 - #ifndef PWMR_BACKLIGHT_AVAILABLE 615 712 if (fbi->pwmr) 616 713 writel(fbi->pwmr, fbi->regs + LCDC_PWMR); 617 - #endif 618 714 writel(fbi->lscr1, fbi->regs + LCDC_LSCR1); 619 715 620 716 /* dmacr = 0 is no valid value, as we need DMA control marks. */ ··· 621 721 622 722 return 0; 623 723 } 624 - 625 - #ifdef CONFIG_PM 626 - /* 627 - * Power management hooks. Note that we won't be called from IRQ context, 628 - * unlike the blank functions above, so we may sleep. 629 - */ 630 - static int imxfb_suspend(struct platform_device *dev, pm_message_t state) 631 - { 632 - struct fb_info *info = platform_get_drvdata(dev); 633 - struct imxfb_info *fbi = info->par; 634 - 635 - pr_debug("%s\n", __func__); 636 - 637 - imxfb_disable_controller(fbi); 638 - return 0; 639 - } 640 - 641 - static int imxfb_resume(struct platform_device *dev) 642 - { 643 - struct fb_info *info = platform_get_drvdata(dev); 644 - struct imxfb_info *fbi = info->par; 645 - 646 - pr_debug("%s\n", __func__); 647 - 648 - imxfb_enable_controller(fbi); 649 - return 0; 650 - } 651 - #else 652 - #define imxfb_suspend NULL 653 - #define imxfb_resume NULL 654 - #endif 655 724 656 725 static int imxfb_init_fbinfo(struct platform_device *pdev) 657 726 { ··· 659 790 info->flags = FBINFO_FLAG_DEFAULT | 660 791 FBINFO_READS_FAST; 661 792 if (pdata) { 662 - info->var.grayscale = pdata->cmap_greyscale; 663 - fbi->cmap_inverse = pdata->cmap_inverse; 664 - fbi->cmap_static = pdata->cmap_static; 665 793 fbi->lscr1 = pdata->lscr1; 666 794 fbi->dmacr = pdata->dmacr; 667 795 fbi->pwmr = pdata->pwmr; 668 - fbi->lcd_power = pdata->lcd_power; 669 - fbi->backlight_power = pdata->backlight_power; 670 796 } else { 671 797 np = pdev->dev.of_node; 672 798 info->var.grayscale = of_property_read_bool(np, ··· 670 806 fbi->cmap_static = of_property_read_bool(np, "cmap-static"); 671 807 672 808 fbi->lscr1 = IMXFB_LSCR1_DEFAULT; 809 + 810 + of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr); 811 + 673 812 of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1); 674 813 675 814 of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr); 676 - 677 - /* These two function pointers could be used by some specific 678 - * platforms. */ 679 - fbi->lcd_power = NULL; 680 - fbi->backlight_power = NULL; 681 815 } 682 816 683 817 return 0; ··· 718 856 return 0; 719 857 } 720 858 859 + static int imxfb_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi) 860 + { 861 + struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); 862 + 863 + if (!fi || fi->par == fbi) 864 + return 1; 865 + 866 + return 0; 867 + } 868 + 869 + static int imxfb_lcd_get_contrast(struct lcd_device *lcddev) 870 + { 871 + struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); 872 + 873 + return fbi->pwmr & 0xff; 874 + } 875 + 876 + static int imxfb_lcd_set_contrast(struct lcd_device *lcddev, int contrast) 877 + { 878 + struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); 879 + 880 + if (fbi->pwmr && fbi->enabled) { 881 + if (contrast > 255) 882 + contrast = 255; 883 + else if (contrast < 0) 884 + contrast = 0; 885 + 886 + fbi->pwmr &= ~0xff; 887 + fbi->pwmr |= contrast; 888 + 889 + writel(fbi->pwmr, fbi->regs + LCDC_PWMR); 890 + } 891 + 892 + return 0; 893 + } 894 + 895 + static int imxfb_lcd_get_power(struct lcd_device *lcddev) 896 + { 897 + struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); 898 + 899 + if (!IS_ERR(fbi->lcd_pwr)) 900 + return regulator_is_enabled(fbi->lcd_pwr); 901 + 902 + return 1; 903 + } 904 + 905 + static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power) 906 + { 907 + struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); 908 + 909 + if (!IS_ERR(fbi->lcd_pwr)) { 910 + if (power) 911 + return regulator_enable(fbi->lcd_pwr); 912 + else 913 + return regulator_disable(fbi->lcd_pwr); 914 + } 915 + 916 + return 0; 917 + } 918 + 919 + static struct lcd_ops imxfb_lcd_ops = { 920 + .check_fb = imxfb_lcd_check_fb, 921 + .get_contrast = imxfb_lcd_get_contrast, 922 + .set_contrast = imxfb_lcd_set_contrast, 923 + .get_power = imxfb_lcd_get_power, 924 + .set_power = imxfb_lcd_set_power, 925 + }; 926 + 927 + static int imxfb_setup(void) 928 + { 929 + char *opt, *options = NULL; 930 + 931 + if (fb_get_options("imxfb", &options)) 932 + return -ENODEV; 933 + 934 + if (!options || !*options) 935 + return 0; 936 + 937 + while ((opt = strsep(&options, ",")) != NULL) { 938 + if (!*opt) 939 + continue; 940 + else 941 + fb_mode = opt; 942 + } 943 + 944 + return 0; 945 + } 946 + 721 947 static int imxfb_probe(struct platform_device *pdev) 722 948 { 723 949 struct imxfb_info *fbi; 950 + struct lcd_device *lcd; 724 951 struct fb_info *info; 725 952 struct imx_fb_platform_data *pdata; 726 953 struct resource *res; ··· 819 868 int bytes_per_pixel; 820 869 821 870 dev_info(&pdev->dev, "i.MX Framebuffer driver\n"); 871 + 872 + ret = imxfb_setup(); 873 + if (ret < 0) 874 + return ret; 822 875 823 876 of_id = of_match_device(imxfb_of_dev_id, &pdev->dev); 824 877 if (of_id) ··· 921 966 goto failed_ioremap; 922 967 } 923 968 924 - /* Seems not being used by anyone, so no support for oftree */ 925 - if (!pdata || !pdata->fixed_screen_cpu) { 926 - fbi->map_size = PAGE_ALIGN(info->fix.smem_len); 927 - fbi->map_cpu = dma_alloc_writecombine(&pdev->dev, 928 - fbi->map_size, &fbi->map_dma, GFP_KERNEL); 969 + fbi->map_size = PAGE_ALIGN(info->fix.smem_len); 970 + info->screen_base = dma_alloc_writecombine(&pdev->dev, fbi->map_size, 971 + &fbi->map_dma, GFP_KERNEL); 929 972 930 - if (!fbi->map_cpu) { 931 - dev_err(&pdev->dev, "Failed to allocate video RAM: %d\n", ret); 932 - ret = -ENOMEM; 933 - goto failed_map; 934 - } 935 - 936 - info->screen_base = fbi->map_cpu; 937 - fbi->screen_cpu = fbi->map_cpu; 938 - fbi->screen_dma = fbi->map_dma; 939 - info->fix.smem_start = fbi->screen_dma; 940 - } else { 941 - /* Fixed framebuffer mapping enables location of the screen in eSRAM */ 942 - fbi->map_cpu = pdata->fixed_screen_cpu; 943 - fbi->map_dma = pdata->fixed_screen_dma; 944 - info->screen_base = fbi->map_cpu; 945 - fbi->screen_cpu = fbi->map_cpu; 946 - fbi->screen_dma = fbi->map_dma; 947 - info->fix.smem_start = fbi->screen_dma; 973 + if (!info->screen_base) { 974 + dev_err(&pdev->dev, "Failed to allocate video RAM: %d\n", ret); 975 + ret = -ENOMEM; 976 + goto failed_map; 948 977 } 978 + 979 + info->fix.smem_start = fbi->map_dma; 949 980 950 981 if (pdata && pdata->init) { 951 982 ret = pdata->init(fbi->pdev); ··· 961 1020 goto failed_register; 962 1021 } 963 1022 1023 + fbi->lcd_pwr = devm_regulator_get(&pdev->dev, "lcd"); 1024 + if (IS_ERR(fbi->lcd_pwr) && (PTR_ERR(fbi->lcd_pwr) == -EPROBE_DEFER)) { 1025 + ret = -EPROBE_DEFER; 1026 + goto failed_lcd; 1027 + } 1028 + 1029 + lcd = devm_lcd_device_register(&pdev->dev, "imxfb-lcd", &pdev->dev, fbi, 1030 + &imxfb_lcd_ops); 1031 + if (IS_ERR(lcd)) { 1032 + ret = PTR_ERR(lcd); 1033 + goto failed_lcd; 1034 + } 1035 + 1036 + lcd->props.max_contrast = 0xff; 1037 + 964 1038 imxfb_enable_controller(fbi); 965 1039 fbi->pdev = pdev; 966 - #ifdef PWMR_BACKLIGHT_AVAILABLE 967 - imxfb_init_backlight(fbi); 968 - #endif 969 1040 970 1041 return 0; 1042 + 1043 + failed_lcd: 1044 + unregister_framebuffer(info); 971 1045 972 1046 failed_register: 973 1047 fb_dealloc_cmap(&info->cmap); ··· 990 1034 if (pdata && pdata->exit) 991 1035 pdata->exit(fbi->pdev); 992 1036 failed_platform_init: 993 - if (pdata && !pdata->fixed_screen_cpu) 994 - dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, 995 - fbi->map_dma); 1037 + dma_free_writecombine(&pdev->dev, fbi->map_size, info->screen_base, 1038 + fbi->map_dma); 996 1039 failed_map: 997 1040 iounmap(fbi->regs); 998 1041 failed_ioremap: ··· 1016 1061 1017 1062 imxfb_disable_controller(fbi); 1018 1063 1019 - #ifdef PWMR_BACKLIGHT_AVAILABLE 1020 - imxfb_exit_backlight(fbi); 1021 - #endif 1022 1064 unregister_framebuffer(info); 1023 1065 1024 1066 pdata = dev_get_platdata(&pdev->dev); ··· 1026 1074 kfree(info->pseudo_palette); 1027 1075 framebuffer_release(info); 1028 1076 1077 + dma_free_writecombine(&pdev->dev, fbi->map_size, info->screen_base, 1078 + fbi->map_dma); 1079 + 1029 1080 iounmap(fbi->regs); 1030 1081 release_mem_region(res->start, resource_size(res)); 1031 1082 1032 1083 return 0; 1033 1084 } 1034 1085 1035 - static void imxfb_shutdown(struct platform_device *dev) 1086 + static int __maybe_unused imxfb_suspend(struct device *dev) 1036 1087 { 1037 - struct fb_info *info = platform_get_drvdata(dev); 1088 + struct fb_info *info = dev_get_drvdata(dev); 1038 1089 struct imxfb_info *fbi = info->par; 1090 + 1039 1091 imxfb_disable_controller(fbi); 1040 - } 1041 1092 1042 - static struct platform_driver imxfb_driver = { 1043 - .suspend = imxfb_suspend, 1044 - .resume = imxfb_resume, 1045 - .remove = imxfb_remove, 1046 - .shutdown = imxfb_shutdown, 1047 - .driver = { 1048 - .name = DRIVER_NAME, 1049 - .of_match_table = imxfb_of_dev_id, 1050 - }, 1051 - .id_table = imxfb_devtype, 1052 - }; 1053 - 1054 - static int imxfb_setup(void) 1055 - { 1056 - #ifndef MODULE 1057 - char *opt, *options = NULL; 1058 - 1059 - if (fb_get_options("imxfb", &options)) 1060 - return -ENODEV; 1061 - 1062 - if (!options || !*options) 1063 - return 0; 1064 - 1065 - while ((opt = strsep(&options, ",")) != NULL) { 1066 - if (!*opt) 1067 - continue; 1068 - else 1069 - fb_mode = opt; 1070 - } 1071 - #endif 1072 1093 return 0; 1073 1094 } 1074 1095 1075 - static int __init imxfb_init(void) 1096 + static int __maybe_unused imxfb_resume(struct device *dev) 1076 1097 { 1077 - int ret = imxfb_setup(); 1098 + struct fb_info *info = dev_get_drvdata(dev); 1099 + struct imxfb_info *fbi = info->par; 1078 1100 1079 - if (ret < 0) 1080 - return ret; 1101 + imxfb_enable_controller(fbi); 1081 1102 1082 - return platform_driver_probe(&imxfb_driver, imxfb_probe); 1103 + return 0; 1083 1104 } 1084 1105 1085 - static void __exit imxfb_cleanup(void) 1086 - { 1087 - platform_driver_unregister(&imxfb_driver); 1088 - } 1106 + static SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume); 1089 1107 1090 - module_init(imxfb_init); 1091 - module_exit(imxfb_cleanup); 1108 + static struct platform_driver imxfb_driver = { 1109 + .driver = { 1110 + .name = DRIVER_NAME, 1111 + .of_match_table = imxfb_of_dev_id, 1112 + .owner = THIS_MODULE, 1113 + .pm = &imxfb_pm_ops, 1114 + }, 1115 + .probe = imxfb_probe, 1116 + .remove = imxfb_remove, 1117 + .id_table = imxfb_devtype, 1118 + }; 1119 + module_platform_driver(imxfb_driver); 1092 1120 1093 1121 MODULE_DESCRIPTION("Freescale i.MX framebuffer driver"); 1094 1122 MODULE_AUTHOR("Sascha Hauer, Pengutronix");
+28 -10
drivers/video/matrox/matroxfb_accel.c
··· 192 192 minfo->accel.m_dwg_rect = M_DWG_TRAP | M_DWG_SOLID | M_DWG_ARZERO | M_DWG_SGNZERO | M_DWG_SHIFTZERO; 193 193 if (isMilleniumII(minfo)) minfo->accel.m_dwg_rect |= M_DWG_TRANSC; 194 194 minfo->accel.m_opmode = mopmode; 195 + minfo->accel.m_access = maccess; 196 + minfo->accel.m_pitch = mpitch; 195 197 } 196 198 197 199 EXPORT_SYMBOL(matrox_cfbX_init); 200 + 201 + static void matrox_accel_restore_maccess(struct matrox_fb_info *minfo) 202 + { 203 + mga_outl(M_MACCESS, minfo->accel.m_access); 204 + mga_outl(M_PITCH, minfo->accel.m_pitch); 205 + } 198 206 199 207 static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy, 200 208 int sx, int dy, int dx, int height, int width) ··· 215 207 CRITBEGIN 216 208 217 209 if ((dy < sy) || ((dy == sy) && (dx <= sx))) { 218 - mga_fifo(2); 210 + mga_fifo(4); 211 + matrox_accel_restore_maccess(minfo); 219 212 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO | 220 213 M_DWG_BFCOL | M_DWG_REPLACE); 221 214 mga_outl(M_AR5, vxres); ··· 224 215 start = sy*vxres+sx+curr_ydstorg(minfo); 225 216 end = start+width; 226 217 } else { 227 - mga_fifo(3); 218 + mga_fifo(5); 219 + matrox_accel_restore_maccess(minfo); 228 220 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE); 229 221 mga_outl(M_SGN, 5); 230 222 mga_outl(M_AR5, -vxres); ··· 234 224 start = end+width; 235 225 dy += height-1; 236 226 } 237 - mga_fifo(4); 227 + mga_fifo(6); 228 + matrox_accel_restore_maccess(minfo); 238 229 mga_outl(M_AR0, end); 239 230 mga_outl(M_AR3, start); 240 231 mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx); ··· 257 246 CRITBEGIN 258 247 259 248 if ((dy < sy) || ((dy == sy) && (dx <= sx))) { 260 - mga_fifo(2); 249 + mga_fifo(4); 250 + matrox_accel_restore_maccess(minfo); 261 251 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO | 262 252 M_DWG_BFCOL | M_DWG_REPLACE); 263 253 mga_outl(M_AR5, vxres); ··· 266 254 start = sy*vxres+sx+curr_ydstorg(minfo); 267 255 end = start+width; 268 256 } else { 269 - mga_fifo(3); 257 + mga_fifo(5); 258 + matrox_accel_restore_maccess(minfo); 270 259 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE); 271 260 mga_outl(M_SGN, 5); 272 261 mga_outl(M_AR5, -vxres); ··· 276 263 start = end+width; 277 264 dy += height-1; 278 265 } 279 - mga_fifo(5); 266 + mga_fifo(7); 267 + matrox_accel_restore_maccess(minfo); 280 268 mga_outl(M_AR0, end); 281 269 mga_outl(M_AR3, start); 282 270 mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx); ··· 312 298 313 299 CRITBEGIN 314 300 315 - mga_fifo(5); 301 + mga_fifo(7); 302 + matrox_accel_restore_maccess(minfo); 316 303 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE); 317 304 mga_outl(M_FCOL, color); 318 305 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); ··· 356 341 width >>= 1; 357 342 sx >>= 1; 358 343 if (width) { 359 - mga_fifo(5); 344 + mga_fifo(7); 345 + matrox_accel_restore_maccess(minfo); 360 346 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE2); 361 347 mga_outl(M_FCOL, bgx); 362 348 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); ··· 431 415 432 416 CRITBEGIN 433 417 434 - mga_fifo(3); 418 + mga_fifo(5); 419 + matrox_accel_restore_maccess(minfo); 435 420 if (easy) 436 421 mga_outl(M_DWGCTL, M_DWG_ILOAD | M_DWG_SGNZERO | M_DWG_SHIFTZERO | M_DWG_BMONOWF | M_DWG_LINEAR | M_DWG_REPLACE); 437 422 else ··· 442 425 fxbndry = ((xx + width - 1) << 16) | xx; 443 426 mmio = minfo->mmio.vbase; 444 427 445 - mga_fifo(6); 428 + mga_fifo(8); 429 + matrox_accel_restore_maccess(minfo); 446 430 mga_writel(mmio, M_FXBNDRY, fxbndry); 447 431 mga_writel(mmio, M_AR0, ar0); 448 432 mga_writel(mmio, M_AR3, 0);
+2 -1
drivers/video/matrox/matroxfb_base.c
··· 1773 1773 FBINFO_HWACCEL_FILLRECT | /* And fillrect */ 1774 1774 FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */ 1775 1775 FBINFO_HWACCEL_XPAN | /* And we support both horizontal */ 1776 - FBINFO_HWACCEL_YPAN; /* And vertical panning */ 1776 + FBINFO_HWACCEL_YPAN | /* And vertical panning */ 1777 + FBINFO_READS_FAST; 1777 1778 minfo->video.len_usable &= PAGE_MASK; 1778 1779 fb_alloc_cmap(&minfo->fbcon.cmap, 256, 1); 1779 1780
+2
drivers/video/matrox/matroxfb_base.h
··· 307 307 #endif 308 308 u_int32_t m_dwg_rect; 309 309 u_int32_t m_opmode; 310 + u_int32_t m_access; 311 + u_int32_t m_pitch; 310 312 }; 311 313 312 314 struct v4l2_queryctrl;
+1 -1
drivers/video/omap2/displays-new/connector-analog-tv.c
··· 31 31 static const struct omap_video_timings tvc_pal_timings = { 32 32 .x_res = 720, 33 33 .y_res = 574, 34 - .pixel_clock = 13500, 34 + .pixelclock = 13500000, 35 35 .hsw = 64, 36 36 .hfp = 12, 37 37 .hbp = 68,
+1 -1
drivers/video/omap2/displays-new/connector-dvi.c
··· 23 23 .x_res = 640, 24 24 .y_res = 480, 25 25 26 - .pixel_clock = 23500, 26 + .pixelclock = 23500000, 27 27 28 28 .hfp = 48, 29 29 .hsw = 32,
+1 -1
drivers/video/omap2/displays-new/connector-hdmi.c
··· 21 21 static const struct omap_video_timings hdmic_default_timings = { 22 22 .x_res = 640, 23 23 .y_res = 480, 24 - .pixel_clock = 25175, 24 + .pixelclock = 25175000, 25 25 .hsw = 96, 26 26 .hfp = 16, 27 27 .hbp = 48,
+1 -1
drivers/video/omap2/displays-new/panel-dsi-cm.c
··· 1184 1184 1185 1185 ddata->timings.x_res = 864; 1186 1186 ddata->timings.y_res = 480; 1187 - ddata->timings.pixel_clock = DIV_ROUND_UP(864 * 480 * 60, 1000); 1187 + ddata->timings.pixelclock = 864 * 480 * 60; 1188 1188 1189 1189 dssdev = &ddata->dssdev; 1190 1190 dssdev->dev = dev;
+1 -1
drivers/video/omap2/displays-new/panel-lgphilips-lb035q02.c
··· 23 23 .x_res = 320, 24 24 .y_res = 240, 25 25 26 - .pixel_clock = 6500, 26 + .pixelclock = 6500000, 27 27 28 28 .hsw = 2, 29 29 .hfp = 20,
+2 -2
drivers/video/omap2/displays-new/panel-nec-nl8048hl11.c
··· 40 40 * NEC PIX Clock Ratings 41 41 * MIN:21.8MHz TYP:23.8MHz MAX:25.7MHz 42 42 */ 43 - #define LCD_PIXEL_CLOCK 23800 43 + #define LCD_PIXEL_CLOCK 23800000 44 44 45 45 static const struct { 46 46 unsigned char addr; ··· 69 69 static const struct omap_video_timings nec_8048_panel_timings = { 70 70 .x_res = LCD_XRES, 71 71 .y_res = LCD_YRES, 72 - .pixel_clock = LCD_PIXEL_CLOCK, 72 + .pixelclock = LCD_PIXEL_CLOCK, 73 73 .hfp = 6, 74 74 .hsw = 1, 75 75 .hbp = 4,
+1 -1
drivers/video/omap2/displays-new/panel-sharp-ls037v7dw01.c
··· 37 37 .x_res = 480, 38 38 .y_res = 640, 39 39 40 - .pixel_clock = 19200, 40 + .pixelclock = 19200000, 41 41 42 42 .hsw = 2, 43 43 .hfp = 1,
+1 -1
drivers/video/omap2/displays-new/panel-sony-acx565akm.c
··· 93 93 static const struct omap_video_timings acx565akm_panel_timings = { 94 94 .x_res = 800, 95 95 .y_res = 480, 96 - .pixel_clock = 24000, 96 + .pixelclock = 24000000, 97 97 .hfp = 28, 98 98 .hsw = 4, 99 99 .hbp = 24,
+1 -1
drivers/video/omap2/displays-new/panel-tpo-td028ttec1.c
··· 45 45 static struct omap_video_timings td028ttec1_panel_timings = { 46 46 .x_res = 480, 47 47 .y_res = 640, 48 - .pixel_clock = 22153, 48 + .pixelclock = 22153000, 49 49 .hfp = 24, 50 50 .hsw = 8, 51 51 .hbp = 8,
+1 -1
drivers/video/omap2/displays-new/panel-tpo-td043mtea1.c
··· 76 76 .x_res = 800, 77 77 .y_res = 480, 78 78 79 - .pixel_clock = 36000, 79 + .pixelclock = 36000000, 80 80 81 81 .hsw = 1, 82 82 .hfp = 68,
+15 -17
drivers/video/omap2/dss/dispc.c
··· 100 100 struct platform_device *pdev; 101 101 void __iomem *base; 102 102 103 - int ctx_loss_cnt; 104 - 105 103 int irq; 106 104 107 105 unsigned long core_clk_rate; ··· 355 357 if (dss_has_feature(FEAT_CORE_CLK_DIV)) 356 358 SR(DIVISOR); 357 359 358 - dispc.ctx_loss_cnt = dss_get_ctx_loss_count(); 359 360 dispc.ctx_valid = true; 360 361 361 - DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt); 362 + DSSDBG("context saved\n"); 362 363 } 363 364 364 365 static void dispc_restore_context(void) 365 366 { 366 - int i, j, ctx; 367 + int i, j; 367 368 368 369 DSSDBG("dispc_restore_context\n"); 369 370 370 371 if (!dispc.ctx_valid) 371 372 return; 372 - 373 - ctx = dss_get_ctx_loss_count(); 374 - 375 - if (ctx >= 0 && ctx == dispc.ctx_loss_cnt) 376 - return; 377 - 378 - DSSDBG("ctx_loss_count: saved %d, current %d\n", 379 - dispc.ctx_loss_cnt, ctx); 380 373 381 374 /*RR(IRQENABLE);*/ 382 375 /*RR(CONTROL);*/ ··· 2873 2884 2874 2885 timings_ok = _dispc_mgr_size_ok(timings->x_res, timings->y_res); 2875 2886 2876 - timings_ok &= _dispc_mgr_pclk_ok(channel, timings->pixel_clock * 1000); 2887 + timings_ok &= _dispc_mgr_pclk_ok(channel, timings->pixelclock); 2877 2888 2878 2889 if (dss_mgr_is_lcd(channel)) { 2879 2890 timings_ok &= _dispc_lcd_timings_ok(timings->hsw, timings->hfp, ··· 2968 2979 xtot = t.x_res + t.hfp + t.hsw + t.hbp; 2969 2980 ytot = t.y_res + t.vfp + t.vsw + t.vbp; 2970 2981 2971 - ht = (timings->pixel_clock * 1000) / xtot; 2972 - vt = (timings->pixel_clock * 1000) / xtot / ytot; 2982 + ht = timings->pixelclock / xtot; 2983 + vt = timings->pixelclock / xtot / ytot; 2973 2984 2974 - DSSDBG("pck %u\n", timings->pixel_clock); 2985 + DSSDBG("pck %u\n", timings->pixelclock); 2975 2986 DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", 2976 2987 t.hsw, t.hfp, t.hbp, t.vsw, t.vfp, t.vbp); 2977 2988 DSSDBG("vsync_level %d hsync_level %d data_pclk_edge %d de_level %d sync_pclk_edge %d\n", ··· 3757 3768 3758 3769 static int dispc_runtime_resume(struct device *dev) 3759 3770 { 3771 + /* 3772 + * The reset value for load mode is 0 (OMAP_DSS_LOAD_CLUT_AND_FRAME) 3773 + * but we always initialize it to 2 (OMAP_DSS_LOAD_FRAME_ONLY) in 3774 + * _omap_dispc_initial_config(). We can thus use it to detect if 3775 + * we have lost register context. 3776 + */ 3777 + if (REG_GET(DISPC_CONFIG, 2, 1) == OMAP_DSS_LOAD_FRAME_ONLY) 3778 + return 0; 3779 + 3760 3780 _omap_dispc_initial_config(); 3761 3781 3762 3782 dispc_restore_context();
+2 -2
drivers/video/omap2/dss/display-sysfs.c
··· 132 132 dssdev->driver->get_timings(dssdev, &t); 133 133 134 134 return snprintf(buf, PAGE_SIZE, "%u,%u/%u/%u/%u,%u/%u/%u/%u\n", 135 - t.pixel_clock, 135 + t.pixelclock, 136 136 t.x_res, t.hfp, t.hbp, t.hsw, 137 137 t.y_res, t.vfp, t.vbp, t.vsw); 138 138 } ··· 158 158 } 159 159 #endif 160 160 if (!found && sscanf(buf, "%u,%hu/%hu/%hu/%hu,%hu/%hu/%hu/%hu", 161 - &t.pixel_clock, 161 + &t.pixelclock, 162 162 &t.x_res, &t.hfp, &t.hbp, &t.hsw, 163 163 &t.y_res, &t.vfp, &t.vbp, &t.vsw) != 9) 164 164 return -EINVAL;
+2 -2
drivers/video/omap2/dss/display.c
··· 248 248 { 249 249 memset(ovt, 0, sizeof(*ovt)); 250 250 251 - ovt->pixel_clock = vm->pixelclock / 1000; 251 + ovt->pixelclock = vm->pixelclock; 252 252 ovt->x_res = vm->hactive; 253 253 ovt->hbp = vm->hback_porch; 254 254 ovt->hfp = vm->hfront_porch; ··· 280 280 { 281 281 memset(vm, 0, sizeof(*vm)); 282 282 283 - vm->pixelclock = ovt->pixel_clock * 1000; 283 + vm->pixelclock = ovt->pixelclock; 284 284 285 285 vm->hactive = ovt->x_res; 286 286 vm->hback_porch = ovt->hbp;
+12 -13
drivers/video/omap2/dss/dpi.c
··· 307 307 int r = 0; 308 308 309 309 if (dpi.dsidev) 310 - r = dpi_set_dsi_clk(mgr->id, t->pixel_clock * 1000, &fck, 310 + r = dpi_set_dsi_clk(mgr->id, t->pixelclock, &fck, 311 311 &lck_div, &pck_div); 312 312 else 313 - r = dpi_set_dispc_clk(t->pixel_clock * 1000, &fck, 313 + r = dpi_set_dispc_clk(t->pixelclock, &fck, 314 314 &lck_div, &pck_div); 315 315 if (r) 316 316 return r; 317 317 318 - pck = fck / lck_div / pck_div / 1000; 318 + pck = fck / lck_div / pck_div; 319 319 320 - if (pck != t->pixel_clock) { 321 - DSSWARN("Could not find exact pixel clock. " 322 - "Requested %d kHz, got %lu kHz\n", 323 - t->pixel_clock, pck); 320 + if (pck != t->pixelclock) { 321 + DSSWARN("Could not find exact pixel clock. Requested %d Hz, got %lu Hz\n", 322 + t->pixelclock, pck); 324 323 325 - t->pixel_clock = pck; 324 + t->pixelclock = pck; 326 325 } 327 326 328 327 dss_mgr_set_timings(mgr, t); ··· 479 480 if (mgr && !dispc_mgr_timings_ok(mgr->id, timings)) 480 481 return -EINVAL; 481 482 482 - if (timings->pixel_clock == 0) 483 + if (timings->pixelclock == 0) 483 484 return -EINVAL; 484 485 485 486 if (dpi.dsidev) { 486 - ok = dpi_dsi_clk_calc(timings->pixel_clock * 1000, &ctx); 487 + ok = dpi_dsi_clk_calc(timings->pixelclock, &ctx); 487 488 if (!ok) 488 489 return -EINVAL; 489 490 490 491 fck = ctx.dsi_cinfo.dsi_pll_hsdiv_dispc_clk; 491 492 } else { 492 - ok = dpi_dss_clk_calc(timings->pixel_clock * 1000, &ctx); 493 + ok = dpi_dss_clk_calc(timings->pixelclock, &ctx); 493 494 if (!ok) 494 495 return -EINVAL; 495 496 ··· 499 500 lck_div = ctx.dispc_cinfo.lck_div; 500 501 pck_div = ctx.dispc_cinfo.pck_div; 501 502 502 - pck = fck / lck_div / pck_div / 1000; 503 + pck = fck / lck_div / pck_div; 503 504 504 - timings->pixel_clock = pck; 505 + timings->pixelclock = pck; 505 506 506 507 return 0; 507 508 }
+8 -8
drivers/video/omap2/dss/dsi.c
··· 4616 4616 4617 4617 static void print_dispc_vm(const char *str, const struct omap_video_timings *t) 4618 4618 { 4619 - unsigned long pck = t->pixel_clock * 1000; 4619 + unsigned long pck = t->pixelclock; 4620 4620 int hact, bl, tot; 4621 4621 4622 4622 hact = t->x_res; ··· 4656 4656 dsi_hact = DIV_ROUND_UP(DIV_ROUND_UP(t->hact * t->bitspp, 8) + 6, t->ndl); 4657 4657 dsi_htot = t->hss + t->hsa + t->hse + t->hbp + dsi_hact + t->hfp; 4658 4658 4659 - vm.pixel_clock = pck / 1000; 4659 + vm.pixelclock = pck; 4660 4660 vm.hsw = div64_u64((u64)(t->hsa + t->hse) * pck, byteclk); 4661 4661 vm.hbp = div64_u64((u64)t->hbp * pck, byteclk); 4662 4662 vm.hfp = div64_u64((u64)t->hfp * pck, byteclk); ··· 4678 4678 ctx->dispc_cinfo.pck = pck; 4679 4679 4680 4680 *t = *ctx->config->timings; 4681 - t->pixel_clock = pck / 1000; 4681 + t->pixelclock = pck; 4682 4682 t->x_res = ctx->config->timings->x_res; 4683 4683 t->y_res = ctx->config->timings->y_res; 4684 4684 t->hsw = t->hfp = t->hbp = t->vsw = 1; ··· 4732 4732 * especially as we go to LP between each pixel packet due to HW 4733 4733 * "feature". So let's just estimate very roughly and multiply by 1.5. 4734 4734 */ 4735 - pck = cfg->timings->pixel_clock * 1000; 4735 + pck = cfg->timings->pixelclock; 4736 4736 pck = pck * 3 / 2; 4737 4737 txbyteclk = pck * bitspp / 8 / ndl; 4738 4738 ··· 4909 4909 4910 4910 dispc_vm = &ctx->dispc_vm; 4911 4911 *dispc_vm = *req_vm; 4912 - dispc_vm->pixel_clock = dispc_pck / 1000; 4912 + dispc_vm->pixelclock = dispc_pck; 4913 4913 4914 4914 if (cfg->trans_mode == OMAP_DSS_DSI_PULSE_MODE) { 4915 4915 hsa = div64_u64((u64)req_vm->hsw * dispc_pck, ··· 5031 5031 ctx->dsi_cinfo.clkin = clkin; 5032 5032 5033 5033 /* these limits should come from the panel driver */ 5034 - ctx->req_pck_min = t->pixel_clock * 1000 - 1000; 5035 - ctx->req_pck_nom = t->pixel_clock * 1000; 5036 - ctx->req_pck_max = t->pixel_clock * 1000 + 1000; 5034 + ctx->req_pck_min = t->pixelclock - 1000; 5035 + ctx->req_pck_nom = t->pixelclock; 5036 + ctx->req_pck_max = t->pixelclock + 1000; 5037 5037 5038 5038 byteclk_min = div64_u64((u64)ctx->req_pck_min * bitspp, ndl * 8); 5039 5039 pll_min = max(cfg->hs_clk_min * 4, byteclk_min * 4 * 4);
-16
drivers/video/omap2/dss/dss.c
··· 154 154 #undef SR 155 155 #undef RR 156 156 157 - int dss_get_ctx_loss_count(void) 158 - { 159 - struct platform_device *core_pdev = dss_get_core_pdev(); 160 - struct omap_dss_board_info *board_data = core_pdev->dev.platform_data; 161 - int cnt; 162 - 163 - if (!board_data->get_context_loss_count) 164 - return -ENOENT; 165 - 166 - cnt = board_data->get_context_loss_count(&dss.pdev->dev); 167 - 168 - WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt); 169 - 170 - return cnt; 171 - } 172 - 173 157 void dss_sdi_init(int datapairs) 174 158 { 175 159 u32 l;
-2
drivers/video/omap2/dss/dss.h
··· 225 225 void dss_debug_dump_clocks(struct seq_file *s); 226 226 #endif 227 227 228 - int dss_get_ctx_loss_count(void); 229 - 230 228 void dss_sdi_init(int datapairs); 231 229 int dss_sdi_enable(void); 232 230 void dss_sdi_disable(void);
+5 -4
drivers/video/omap2/dss/hdmi4.c
··· 153 153 154 154 DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res); 155 155 156 - phy = p->pixel_clock; 156 + /* the functions below use kHz pixel clock. TODO: change to Hz */ 157 + phy = p->pixelclock / 1000; 157 158 158 159 hdmi_pll_compute(&hdmi.pll, clk_get_rate(hdmi.sys_clk), phy); 159 160 ··· 239 238 if (t != NULL) { 240 239 hdmi.cfg = *t; 241 240 242 - dispc_set_tv_pclk(t->timings.pixel_clock * 1000); 241 + dispc_set_tv_pclk(t->timings.pixelclock); 243 242 } else { 244 243 hdmi.cfg.timings = *timings; 245 244 hdmi.cfg.cm.code = 0; 246 245 hdmi.cfg.cm.mode = HDMI_DVI; 247 246 248 - dispc_set_tv_pclk(timings->pixel_clock * 1000); 247 + dispc_set_tv_pclk(timings->pixelclock); 249 248 } 250 249 251 250 DSSDBG("using mode: %s, code %d\n", hdmi.cfg.cm.mode == HDMI_DVI ? ··· 510 509 struct omap_dss_audio *audio) 511 510 { 512 511 int r; 513 - u32 pclk = hdmi.cfg.timings.pixel_clock; 512 + u32 pclk = hdmi.cfg.timings.pixelclock; 514 513 515 514 mutex_lock(&hdmi.lock); 516 515
+37 -37
drivers/video/omap2/dss/hdmi_common.c
··· 23 23 24 24 static const struct hdmi_config cea_timings[] = { 25 25 { 26 - { 640, 480, 25200, 96, 16, 48, 2, 10, 33, 26 + { 640, 480, 25200000, 96, 16, 48, 2, 10, 33, 27 27 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 28 28 false, }, 29 29 { 1, HDMI_HDMI }, 30 30 }, 31 31 { 32 - { 720, 480, 27027, 62, 16, 60, 6, 9, 30, 32 + { 720, 480, 27027000, 62, 16, 60, 6, 9, 30, 33 33 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 34 34 false, }, 35 35 { 2, HDMI_HDMI }, 36 36 }, 37 37 { 38 - { 1280, 720, 74250, 40, 110, 220, 5, 5, 20, 38 + { 1280, 720, 74250000, 40, 110, 220, 5, 5, 20, 39 39 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 40 40 false, }, 41 41 { 4, HDMI_HDMI }, 42 42 }, 43 43 { 44 - { 1920, 540, 74250, 44, 88, 148, 5, 2, 15, 44 + { 1920, 540, 74250000, 44, 88, 148, 5, 2, 15, 45 45 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 46 46 true, }, 47 47 { 5, HDMI_HDMI }, 48 48 }, 49 49 { 50 - { 1440, 240, 27027, 124, 38, 114, 3, 4, 15, 50 + { 1440, 240, 27027000, 124, 38, 114, 3, 4, 15, 51 51 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 52 52 true, }, 53 53 { 6, HDMI_HDMI }, 54 54 }, 55 55 { 56 - { 1920, 1080, 148500, 44, 88, 148, 5, 4, 36, 56 + { 1920, 1080, 148500000, 44, 88, 148, 5, 4, 36, 57 57 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 58 58 false, }, 59 59 { 16, HDMI_HDMI }, 60 60 }, 61 61 { 62 - { 720, 576, 27000, 64, 12, 68, 5, 5, 39, 62 + { 720, 576, 27000000, 64, 12, 68, 5, 5, 39, 63 63 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 64 64 false, }, 65 65 { 17, HDMI_HDMI }, 66 66 }, 67 67 { 68 - { 1280, 720, 74250, 40, 440, 220, 5, 5, 20, 68 + { 1280, 720, 74250000, 40, 440, 220, 5, 5, 20, 69 69 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 70 70 false, }, 71 71 { 19, HDMI_HDMI }, 72 72 }, 73 73 { 74 - { 1920, 540, 74250, 44, 528, 148, 5, 2, 15, 74 + { 1920, 540, 74250000, 44, 528, 148, 5, 2, 15, 75 75 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 76 76 true, }, 77 77 { 20, HDMI_HDMI }, 78 78 }, 79 79 { 80 - { 1440, 288, 27000, 126, 24, 138, 3, 2, 19, 80 + { 1440, 288, 27000000, 126, 24, 138, 3, 2, 19, 81 81 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 82 82 true, }, 83 83 { 21, HDMI_HDMI }, 84 84 }, 85 85 { 86 - { 1440, 576, 54000, 128, 24, 136, 5, 5, 39, 86 + { 1440, 576, 54000000, 128, 24, 136, 5, 5, 39, 87 87 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 88 88 false, }, 89 89 { 29, HDMI_HDMI }, 90 90 }, 91 91 { 92 - { 1920, 1080, 148500, 44, 528, 148, 5, 4, 36, 92 + { 1920, 1080, 148500000, 44, 528, 148, 5, 4, 36, 93 93 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 94 94 false, }, 95 95 { 31, HDMI_HDMI }, 96 96 }, 97 97 { 98 - { 1920, 1080, 74250, 44, 638, 148, 5, 4, 36, 98 + { 1920, 1080, 74250000, 44, 638, 148, 5, 4, 36, 99 99 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 100 100 false, }, 101 101 { 32, HDMI_HDMI }, 102 102 }, 103 103 { 104 - { 2880, 480, 108108, 248, 64, 240, 6, 9, 30, 104 + { 2880, 480, 108108000, 248, 64, 240, 6, 9, 30, 105 105 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 106 106 false, }, 107 107 { 35, HDMI_HDMI }, 108 108 }, 109 109 { 110 - { 2880, 576, 108000, 256, 48, 272, 5, 5, 39, 110 + { 2880, 576, 108000000, 256, 48, 272, 5, 5, 39, 111 111 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 112 112 false, }, 113 113 { 37, HDMI_HDMI }, ··· 117 117 static const struct hdmi_config vesa_timings[] = { 118 118 /* VESA From Here */ 119 119 { 120 - { 640, 480, 25175, 96, 16, 48, 2, 11, 31, 120 + { 640, 480, 25175000, 96, 16, 48, 2, 11, 31, 121 121 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 122 122 false, }, 123 123 { 4, HDMI_DVI }, 124 124 }, 125 125 { 126 - { 800, 600, 40000, 128, 40, 88, 4, 1, 23, 126 + { 800, 600, 40000000, 128, 40, 88, 4, 1, 23, 127 127 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 128 128 false, }, 129 129 { 9, HDMI_DVI }, 130 130 }, 131 131 { 132 - { 848, 480, 33750, 112, 16, 112, 8, 6, 23, 132 + { 848, 480, 33750000, 112, 16, 112, 8, 6, 23, 133 133 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 134 134 false, }, 135 135 { 0xE, HDMI_DVI }, 136 136 }, 137 137 { 138 - { 1280, 768, 79500, 128, 64, 192, 7, 3, 20, 138 + { 1280, 768, 79500000, 128, 64, 192, 7, 3, 20, 139 139 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW, 140 140 false, }, 141 141 { 0x17, HDMI_DVI }, 142 142 }, 143 143 { 144 - { 1280, 800, 83500, 128, 72, 200, 6, 3, 22, 144 + { 1280, 800, 83500000, 128, 72, 200, 6, 3, 22, 145 145 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW, 146 146 false, }, 147 147 { 0x1C, HDMI_DVI }, 148 148 }, 149 149 { 150 - { 1360, 768, 85500, 112, 64, 256, 6, 3, 18, 150 + { 1360, 768, 85500000, 112, 64, 256, 6, 3, 18, 151 151 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 152 152 false, }, 153 153 { 0x27, HDMI_DVI }, 154 154 }, 155 155 { 156 - { 1280, 960, 108000, 112, 96, 312, 3, 1, 36, 156 + { 1280, 960, 108000000, 112, 96, 312, 3, 1, 36, 157 157 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 158 158 false, }, 159 159 { 0x20, HDMI_DVI }, 160 160 }, 161 161 { 162 - { 1280, 1024, 108000, 112, 48, 248, 3, 1, 38, 162 + { 1280, 1024, 108000000, 112, 48, 248, 3, 1, 38, 163 163 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 164 164 false, }, 165 165 { 0x23, HDMI_DVI }, 166 166 }, 167 167 { 168 - { 1024, 768, 65000, 136, 24, 160, 6, 3, 29, 168 + { 1024, 768, 65000000, 136, 24, 160, 6, 3, 29, 169 169 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW, 170 170 false, }, 171 171 { 0x10, HDMI_DVI }, 172 172 }, 173 173 { 174 - { 1400, 1050, 121750, 144, 88, 232, 4, 3, 32, 174 + { 1400, 1050, 121750000, 144, 88, 232, 4, 3, 32, 175 175 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW, 176 176 false, }, 177 177 { 0x2A, HDMI_DVI }, 178 178 }, 179 179 { 180 - { 1440, 900, 106500, 152, 80, 232, 6, 3, 25, 180 + { 1440, 900, 106500000, 152, 80, 232, 6, 3, 25, 181 181 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW, 182 182 false, }, 183 183 { 0x2F, HDMI_DVI }, 184 184 }, 185 185 { 186 - { 1680, 1050, 146250, 176 , 104, 280, 6, 3, 30, 186 + { 1680, 1050, 146250000, 176 , 104, 280, 6, 3, 30, 187 187 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW, 188 188 false, }, 189 189 { 0x3A, HDMI_DVI }, 190 190 }, 191 191 { 192 - { 1366, 768, 85500, 143, 70, 213, 3, 3, 24, 192 + { 1366, 768, 85500000, 143, 70, 213, 3, 3, 24, 193 193 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 194 194 false, }, 195 195 { 0x51, HDMI_DVI }, 196 196 }, 197 197 { 198 - { 1920, 1080, 148500, 44, 148, 80, 5, 4, 36, 198 + { 1920, 1080, 148500000, 44, 148, 80, 5, 4, 36, 199 199 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 200 200 false, }, 201 201 { 0x52, HDMI_DVI }, 202 202 }, 203 203 { 204 - { 1280, 768, 68250, 32, 48, 80, 7, 3, 12, 204 + { 1280, 768, 68250000, 32, 48, 80, 7, 3, 12, 205 205 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH, 206 206 false, }, 207 207 { 0x16, HDMI_DVI }, 208 208 }, 209 209 { 210 - { 1400, 1050, 101000, 32, 48, 80, 4, 3, 23, 210 + { 1400, 1050, 101000000, 32, 48, 80, 4, 3, 23, 211 211 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH, 212 212 false, }, 213 213 { 0x29, HDMI_DVI }, 214 214 }, 215 215 { 216 - { 1680, 1050, 119000, 32, 48, 80, 6, 3, 21, 216 + { 1680, 1050, 119000000, 32, 48, 80, 6, 3, 21, 217 217 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH, 218 218 false, }, 219 219 { 0x39, HDMI_DVI }, 220 220 }, 221 221 { 222 - { 1280, 800, 79500, 32, 48, 80, 6, 3, 14, 222 + { 1280, 800, 79500000, 32, 48, 80, 6, 3, 14, 223 223 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH, 224 224 false, }, 225 225 { 0x1B, HDMI_DVI }, 226 226 }, 227 227 { 228 - { 1280, 720, 74250, 40, 110, 220, 5, 5, 20, 228 + { 1280, 720, 74250000, 40, 110, 220, 5, 5, 20, 229 229 OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, 230 230 false, }, 231 231 { 0x55, HDMI_DVI }, 232 232 }, 233 233 { 234 - { 1920, 1200, 154000, 32, 48, 80, 6, 3, 26, 234 + { 1920, 1200, 154000000, 32, 48, 80, 6, 3, 26, 235 235 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH, 236 236 false, }, 237 237 { 0x44, HDMI_DVI }, ··· 277 277 { 278 278 int timing1_vsync, timing1_hsync, timing2_vsync, timing2_hsync; 279 279 280 - if ((DIV_ROUND_CLOSEST(timing2->pixel_clock, 1000) == 281 - DIV_ROUND_CLOSEST(timing1->pixel_clock, 1000)) && 280 + if ((DIV_ROUND_CLOSEST(timing2->pixelclock, 1000000) == 281 + DIV_ROUND_CLOSEST(timing1->pixelclock, 1000000)) && 282 282 (timing2->x_res == timing1->x_res) && 283 283 (timing2->y_res == timing1->y_res)) { 284 284
+7 -8
drivers/video/omap2/dss/sdi.c
··· 149 149 t->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; 150 150 t->sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; 151 151 152 - r = sdi_calc_clock_div(t->pixel_clock * 1000, &fck, &dispc_cinfo); 152 + r = sdi_calc_clock_div(t->pixelclock, &fck, &dispc_cinfo); 153 153 if (r) 154 154 goto err_calc_clock_div; 155 155 156 156 sdi.mgr_config.clock_info = dispc_cinfo; 157 157 158 - pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div / 1000; 158 + pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div; 159 159 160 - if (pck != t->pixel_clock) { 161 - DSSWARN("Could not find exact pixel clock. Requested %d kHz, " 162 - "got %lu kHz\n", 163 - t->pixel_clock, pck); 160 + if (pck != t->pixelclock) { 161 + DSSWARN("Could not find exact pixel clock. Requested %d Hz, got %lu Hz\n", 162 + t->pixelclock, pck); 164 163 165 - t->pixel_clock = pck; 164 + t->pixelclock = pck; 166 165 } 167 166 168 167 ··· 243 244 if (mgr && !dispc_mgr_timings_ok(mgr->id, timings)) 244 245 return -EINVAL; 245 246 246 - if (timings->pixel_clock == 0) 247 + if (timings->pixelclock == 0) 247 248 return -EINVAL; 248 249 249 250 return 0;
+2 -2
drivers/video/omap2/dss/venc.c
··· 264 264 const struct omap_video_timings omap_dss_pal_timings = { 265 265 .x_res = 720, 266 266 .y_res = 574, 267 - .pixel_clock = 13500, 267 + .pixelclock = 13500000, 268 268 .hsw = 64, 269 269 .hfp = 12, 270 270 .hbp = 68, ··· 279 279 const struct omap_video_timings omap_dss_ntsc_timings = { 280 280 .x_res = 720, 281 281 .y_res = 482, 282 - .pixel_clock = 13500, 282 + .pixelclock = 13500000, 283 283 .hsw = 64, 284 284 .hfp = 16, 285 285 .hbp = 58,
+1 -1
drivers/video/omap2/dss/venc_panel.c
··· 89 89 const struct omap_video_timings default_timings = { 90 90 .x_res = 720, 91 91 .y_res = 574, 92 - .pixel_clock = 13500, 92 + .pixelclock = 13500000, 93 93 .hsw = 64, 94 94 .hfp = 12, 95 95 .hbp = 68,
+4 -4
drivers/video/omap2/omapfb/omapfb-main.c
··· 723 723 display->driver->get_timings(display, &timings); 724 724 725 725 /* pixclock in ps, the rest in pixclock */ 726 - var->pixclock = timings.pixel_clock != 0 ? 727 - KHZ2PICOS(timings.pixel_clock) : 726 + var->pixclock = timings.pixelclock != 0 ? 727 + KHZ2PICOS(timings.pixelclock / 1000) : 728 728 0; 729 729 var->left_margin = timings.hbp; 730 730 var->right_margin = timings.hfp; ··· 2077 2077 timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; 2078 2078 } 2079 2079 2080 - timings->pixel_clock = PICOS2KHZ(var->pixclock); 2080 + timings->pixelclock = PICOS2KHZ(var->pixclock) * 1000; 2081 2081 timings->hbp = var->left_margin; 2082 2082 timings->hfp = var->right_margin; 2083 2083 timings->vbp = var->upper_margin; ··· 2229 2229 2230 2230 t->x_res = m->xres; 2231 2231 t->y_res = m->yres; 2232 - t->pixel_clock = PICOS2KHZ(m->pixclock); 2232 + t->pixelclock = PICOS2KHZ(m->pixclock) * 1000; 2233 2233 t->hsw = m->hsync_len; 2234 2234 t->hfp = m->right_margin; 2235 2235 t->hbp = m->left_margin;
+90 -119
drivers/video/pxa3xx-gcu.c
··· 107 107 struct timeval base_time; 108 108 109 109 struct pxa3xx_gcu_batch *free; 110 - 111 110 struct pxa3xx_gcu_batch *ready; 112 111 struct pxa3xx_gcu_batch *ready_last; 113 112 struct pxa3xx_gcu_batch *running; ··· 367 368 368 369 /* Misc device layer */ 369 370 370 - static inline struct pxa3xx_gcu_priv *file_dev(struct file *file) 371 + static inline struct pxa3xx_gcu_priv *to_pxa3xx_gcu_priv(struct file *file) 371 372 { 372 373 struct miscdevice *dev = file->private_data; 373 374 return container_of(dev, struct pxa3xx_gcu_priv, misc_dev); 374 375 } 375 376 377 + /* 378 + * provide an empty .open callback, so the core sets file->private_data 379 + * for us. 380 + */ 381 + static int pxa3xx_gcu_open(struct inode *inode, struct file *file) 382 + { 383 + return 0; 384 + } 385 + 376 386 static ssize_t 377 - pxa3xx_gcu_misc_write(struct file *file, const char *buff, 378 - size_t count, loff_t *offp) 387 + pxa3xx_gcu_write(struct file *file, const char *buff, 388 + size_t count, loff_t *offp) 379 389 { 380 390 int ret; 381 391 unsigned long flags; 382 392 struct pxa3xx_gcu_batch *buffer; 383 - struct pxa3xx_gcu_priv *priv = file_dev(file); 393 + struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file); 384 394 385 395 int words = count / 4; 386 396 387 397 /* Does not need to be atomic. There's a lock in user space, 388 398 * but anyhow, this is just for statistics. */ 389 399 priv->shared->num_writes++; 390 - 391 400 priv->shared->num_words += words; 392 401 393 402 /* Last word reserved for batch buffer end command */ ··· 413 406 * Get buffer from free list 414 407 */ 415 408 spin_lock_irqsave(&priv->spinlock, flags); 416 - 417 409 buffer = priv->free; 418 410 priv->free = buffer->next; 419 - 420 411 spin_unlock_irqrestore(&priv->spinlock, flags); 421 412 422 413 ··· 459 454 460 455 461 456 static long 462 - pxa3xx_gcu_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 457 + pxa3xx_gcu_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 463 458 { 464 459 unsigned long flags; 465 - struct pxa3xx_gcu_priv *priv = file_dev(file); 460 + struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file); 466 461 467 462 switch (cmd) { 468 463 case PXA3XX_GCU_IOCTL_RESET: ··· 479 474 } 480 475 481 476 static int 482 - pxa3xx_gcu_misc_mmap(struct file *file, struct vm_area_struct *vma) 477 + pxa3xx_gcu_mmap(struct file *file, struct vm_area_struct *vma) 483 478 { 484 479 unsigned int size = vma->vm_end - vma->vm_start; 485 - struct pxa3xx_gcu_priv *priv = file_dev(file); 480 + struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file); 486 481 487 482 switch (vma->vm_pgoff) { 488 483 case 0: ··· 537 532 #endif 538 533 539 534 static int 540 - add_buffer(struct platform_device *dev, 541 - struct pxa3xx_gcu_priv *priv) 535 + pxa3xx_gcu_add_buffer(struct device *dev, 536 + struct pxa3xx_gcu_priv *priv) 542 537 { 543 538 struct pxa3xx_gcu_batch *buffer; 544 539 ··· 546 541 if (!buffer) 547 542 return -ENOMEM; 548 543 549 - buffer->ptr = dma_alloc_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4, 544 + buffer->ptr = dma_alloc_coherent(dev, PXA3XX_GCU_BATCH_WORDS * 4, 550 545 &buffer->phys, GFP_KERNEL); 551 546 if (!buffer->ptr) { 552 547 kfree(buffer); ··· 554 549 } 555 550 556 551 buffer->next = priv->free; 557 - 558 552 priv->free = buffer; 559 553 560 554 return 0; 561 555 } 562 556 563 557 static void 564 - free_buffers(struct platform_device *dev, 565 - struct pxa3xx_gcu_priv *priv) 558 + pxa3xx_gcu_free_buffers(struct device *dev, 559 + struct pxa3xx_gcu_priv *priv) 566 560 { 567 561 struct pxa3xx_gcu_batch *next, *buffer = priv->free; 568 562 569 563 while (buffer) { 570 564 next = buffer->next; 571 565 572 - dma_free_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4, 566 + dma_free_coherent(dev, PXA3XX_GCU_BATCH_WORDS * 4, 573 567 buffer->ptr, buffer->phys); 574 568 575 569 kfree(buffer); 576 - 577 570 buffer = next; 578 571 } 579 572 580 573 priv->free = NULL; 581 574 } 582 575 583 - static const struct file_operations misc_fops = { 584 - .owner = THIS_MODULE, 585 - .write = pxa3xx_gcu_misc_write, 586 - .unlocked_ioctl = pxa3xx_gcu_misc_ioctl, 587 - .mmap = pxa3xx_gcu_misc_mmap 576 + static const struct file_operations pxa3xx_gcu_miscdev_fops = { 577 + .owner = THIS_MODULE, 578 + .open = pxa3xx_gcu_open, 579 + .write = pxa3xx_gcu_write, 580 + .unlocked_ioctl = pxa3xx_gcu_ioctl, 581 + .mmap = pxa3xx_gcu_mmap, 588 582 }; 589 583 590 - static int pxa3xx_gcu_probe(struct platform_device *dev) 584 + static int pxa3xx_gcu_probe(struct platform_device *pdev) 591 585 { 592 586 int i, ret, irq; 593 587 struct resource *r; 594 588 struct pxa3xx_gcu_priv *priv; 589 + struct device *dev = &pdev->dev; 595 590 596 - priv = kzalloc(sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL); 591 + priv = devm_kzalloc(dev, sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL); 597 592 if (!priv) 598 593 return -ENOMEM; 599 - 600 - for (i = 0; i < 8; i++) { 601 - ret = add_buffer(dev, priv); 602 - if (ret) { 603 - dev_err(&dev->dev, "failed to allocate DMA memory\n"); 604 - goto err_free_priv; 605 - } 606 - } 607 594 608 595 init_waitqueue_head(&priv->wait_idle); 609 596 init_waitqueue_head(&priv->wait_free); ··· 608 611 609 612 priv->misc_dev.minor = MISCDEV_MINOR, 610 613 priv->misc_dev.name = DRV_NAME, 611 - priv->misc_dev.fops = &misc_fops, 614 + priv->misc_dev.fops = &pxa3xx_gcu_miscdev_fops; 615 + 616 + /* handle IO resources */ 617 + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 618 + priv->mmio_base = devm_request_and_ioremap(dev, r); 619 + if (IS_ERR(priv->mmio_base)) { 620 + dev_err(dev, "failed to map I/O memory\n"); 621 + return PTR_ERR(priv->mmio_base); 622 + } 623 + 624 + /* enable the clock */ 625 + priv->clk = devm_clk_get(dev, NULL); 626 + if (IS_ERR(priv->clk)) { 627 + dev_err(dev, "failed to get clock\n"); 628 + return PTR_ERR(priv->clk); 629 + } 630 + 631 + /* request the IRQ */ 632 + irq = platform_get_irq(pdev, 0); 633 + if (irq < 0) { 634 + dev_err(dev, "no IRQ defined\n"); 635 + return -ENODEV; 636 + } 637 + 638 + ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq, 639 + 0, DRV_NAME, priv); 640 + if (ret < 0) { 641 + dev_err(dev, "request_irq failed\n"); 642 + return ret; 643 + } 644 + 645 + /* allocate dma memory */ 646 + priv->shared = dma_alloc_coherent(dev, SHARED_SIZE, 647 + &priv->shared_phys, GFP_KERNEL); 648 + if (!priv->shared) { 649 + dev_err(dev, "failed to allocate DMA memory\n"); 650 + return -ENOMEM; 651 + } 612 652 613 653 /* register misc device */ 614 654 ret = misc_register(&priv->misc_dev); 615 655 if (ret < 0) { 616 - dev_err(&dev->dev, "misc_register() for minor %d failed\n", 656 + dev_err(dev, "misc_register() for minor %d failed\n", 617 657 MISCDEV_MINOR); 618 - goto err_free_priv; 619 - } 620 - 621 - /* handle IO resources */ 622 - r = platform_get_resource(dev, IORESOURCE_MEM, 0); 623 - if (r == NULL) { 624 - dev_err(&dev->dev, "no I/O memory resource defined\n"); 625 - ret = -ENODEV; 626 - goto err_misc_deregister; 627 - } 628 - 629 - if (!request_mem_region(r->start, resource_size(r), dev->name)) { 630 - dev_err(&dev->dev, "failed to request I/O memory\n"); 631 - ret = -EBUSY; 632 - goto err_misc_deregister; 633 - } 634 - 635 - priv->mmio_base = ioremap_nocache(r->start, resource_size(r)); 636 - if (!priv->mmio_base) { 637 - dev_err(&dev->dev, "failed to map I/O memory\n"); 638 - ret = -EBUSY; 639 - goto err_free_mem_region; 640 - } 641 - 642 - /* allocate dma memory */ 643 - priv->shared = dma_alloc_coherent(&dev->dev, SHARED_SIZE, 644 - &priv->shared_phys, GFP_KERNEL); 645 - 646 - if (!priv->shared) { 647 - dev_err(&dev->dev, "failed to allocate DMA memory\n"); 648 - ret = -ENOMEM; 649 - goto err_free_io; 650 - } 651 - 652 - /* enable the clock */ 653 - priv->clk = clk_get(&dev->dev, NULL); 654 - if (IS_ERR(priv->clk)) { 655 - dev_err(&dev->dev, "failed to get clock\n"); 656 - ret = -ENODEV; 657 658 goto err_free_dma; 658 659 } 659 660 660 661 ret = clk_enable(priv->clk); 661 662 if (ret < 0) { 662 - dev_err(&dev->dev, "failed to enable clock\n"); 663 - goto err_put_clk; 663 + dev_err(dev, "failed to enable clock\n"); 664 + goto err_misc_deregister; 664 665 } 665 666 666 - /* request the IRQ */ 667 - irq = platform_get_irq(dev, 0); 668 - if (irq < 0) { 669 - dev_err(&dev->dev, "no IRQ defined\n"); 670 - ret = -ENODEV; 671 - goto err_put_clk; 667 + for (i = 0; i < 8; i++) { 668 + ret = pxa3xx_gcu_add_buffer(dev, priv); 669 + if (ret) { 670 + dev_err(dev, "failed to allocate DMA memory\n"); 671 + goto err_disable_clk; 672 + } 672 673 } 673 674 674 - ret = request_irq(irq, pxa3xx_gcu_handle_irq, 675 - 0, DRV_NAME, priv); 676 - if (ret) { 677 - dev_err(&dev->dev, "request_irq failed\n"); 678 - ret = -EBUSY; 679 - goto err_put_clk; 680 - } 681 - 682 - platform_set_drvdata(dev, priv); 675 + platform_set_drvdata(pdev, priv); 683 676 priv->resource_mem = r; 684 677 pxa3xx_gcu_reset(priv); 685 678 pxa3xx_gcu_init_debug_timer(); 686 679 687 - dev_info(&dev->dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", 680 + dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", 688 681 (void *) r->start, (void *) priv->shared_phys, 689 682 SHARED_SIZE, irq); 690 683 return 0; 691 684 692 - err_put_clk: 693 - clk_disable(priv->clk); 694 - clk_put(priv->clk); 695 - 696 685 err_free_dma: 697 - dma_free_coherent(&dev->dev, SHARED_SIZE, 686 + dma_free_coherent(dev, SHARED_SIZE, 698 687 priv->shared, priv->shared_phys); 699 - 700 - err_free_io: 701 - iounmap(priv->mmio_base); 702 - 703 - err_free_mem_region: 704 - release_mem_region(r->start, resource_size(r)); 705 688 706 689 err_misc_deregister: 707 690 misc_deregister(&priv->misc_dev); 708 691 709 - err_free_priv: 710 - free_buffers(dev, priv); 711 - kfree(priv); 692 + err_disable_clk: 693 + clk_disable(priv->clk); 694 + 712 695 return ret; 713 696 } 714 697 715 - static int pxa3xx_gcu_remove(struct platform_device *dev) 698 + static int pxa3xx_gcu_remove(struct platform_device *pdev) 716 699 { 717 - struct pxa3xx_gcu_priv *priv = platform_get_drvdata(dev); 718 - struct resource *r = priv->resource_mem; 700 + struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev); 701 + struct device *dev = &pdev->dev; 719 702 720 703 pxa3xx_gcu_wait_idle(priv); 721 - 722 704 misc_deregister(&priv->misc_dev); 723 - dma_free_coherent(&dev->dev, SHARED_SIZE, 724 - priv->shared, priv->shared_phys); 725 - iounmap(priv->mmio_base); 726 - release_mem_region(r->start, resource_size(r)); 727 - clk_disable(priv->clk); 728 - free_buffers(dev, priv); 729 - kfree(priv); 705 + dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys); 706 + pxa3xx_gcu_free_buffers(dev, priv); 730 707 731 708 return 0; 732 709 }
+1
drivers/video/sis/init.c
··· 651 651 switch(VDisplay) { 652 652 case 720: 653 653 ModeIndex = ModeIndex_1280x720[Depth]; 654 + break; 654 655 case 768: 655 656 if(VGAEngine == SIS_300_VGA) { 656 657 ModeIndex = ModeIndex_300_1280x768[Depth];
+73 -225
drivers/video/tgafb.c
··· 182 182 183 183 if (var->xres_virtual != var->xres || var->yres_virtual != var->yres) 184 184 return -EINVAL; 185 + if (var->xres * var->yres * (var->bits_per_pixel >> 3) > info->fix.smem_len) 186 + return -EINVAL; 185 187 if (var->nonstd) 186 188 return -EINVAL; 187 189 if (1000000000 / var->pixclock > TGA_PLL_MAX_FREQ) ··· 192 190 return -EINVAL; 193 191 194 192 /* Some of the acceleration routines assume the line width is 195 - a multiple of 64 bytes. */ 196 - if (var->xres * (par->tga_type == TGA_TYPE_8PLANE ? 1 : 4) % 64) 193 + a multiple of 8 bytes. */ 194 + if (var->xres * (par->tga_type == TGA_TYPE_8PLANE ? 1 : 4) % 8) 197 195 return -EINVAL; 198 196 199 197 return 0; ··· 264 262 par->yres = info->var.yres; 265 263 par->pll_freq = pll_freq = 1000000000 / info->var.pixclock; 266 264 par->bits_per_pixel = info->var.bits_per_pixel; 265 + info->fix.line_length = par->xres * (par->bits_per_pixel >> 3); 267 266 268 267 tga_type = par->tga_type; 269 268 ··· 1139 1136 __raw_writel(TGA_MODE_SBM_24BPP|TGA_MODE_SIMPLE, tga_regs+TGA_MODE_REG); 1140 1137 } 1141 1138 1142 - /* The general case of forward copy in 8bpp mode. */ 1143 - static inline void 1144 - copyarea_foreward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, 1145 - u32 height, u32 width, u32 line_length) 1146 - { 1147 - struct tga_par *par = (struct tga_par *) info->par; 1148 - unsigned long i, copied, left; 1149 - unsigned long dpos, spos, dalign, salign, yincr; 1150 - u32 smask_first, dmask_first, dmask_last; 1151 - int pixel_shift, need_prime, need_second; 1152 - unsigned long n64, n32, xincr_first; 1153 - void __iomem *tga_regs; 1154 - void __iomem *tga_fb; 1155 - 1156 - yincr = line_length; 1157 - if (dy > sy) { 1158 - dy += height - 1; 1159 - sy += height - 1; 1160 - yincr = -yincr; 1161 - } 1162 - 1163 - /* Compute the offsets and alignments in the frame buffer. 1164 - More than anything else, these control how we do copies. */ 1165 - dpos = dy * line_length + dx; 1166 - spos = sy * line_length + sx; 1167 - dalign = dpos & 7; 1168 - salign = spos & 7; 1169 - dpos &= -8; 1170 - spos &= -8; 1171 - 1172 - /* Compute the value for the PIXELSHIFT register. This controls 1173 - both non-co-aligned source and destination and copy direction. */ 1174 - if (dalign >= salign) 1175 - pixel_shift = dalign - salign; 1176 - else 1177 - pixel_shift = 8 - (salign - dalign); 1178 - 1179 - /* Figure out if we need an additional priming step for the 1180 - residue register. */ 1181 - need_prime = (salign > dalign); 1182 - if (need_prime) 1183 - dpos -= 8; 1184 - 1185 - /* Begin by copying the leading unaligned destination. Copy enough 1186 - to make the next destination address 32-byte aligned. */ 1187 - copied = 32 - (dalign + (dpos & 31)); 1188 - if (copied == 32) 1189 - copied = 0; 1190 - xincr_first = (copied + 7) & -8; 1191 - smask_first = dmask_first = (1ul << copied) - 1; 1192 - smask_first <<= salign; 1193 - dmask_first <<= dalign + need_prime*8; 1194 - if (need_prime && copied > 24) 1195 - copied -= 8; 1196 - left = width - copied; 1197 - 1198 - /* Care for small copies. */ 1199 - if (copied > width) { 1200 - u32 t; 1201 - t = (1ul << width) - 1; 1202 - t <<= dalign + need_prime*8; 1203 - dmask_first &= t; 1204 - left = 0; 1205 - } 1206 - 1207 - /* Attempt to use 64-byte copies. This is only possible if the 1208 - source and destination are co-aligned at 64 bytes. */ 1209 - n64 = need_second = 0; 1210 - if ((dpos & 63) == (spos & 63) 1211 - && (height == 1 || line_length % 64 == 0)) { 1212 - /* We may need a 32-byte copy to ensure 64 byte alignment. */ 1213 - need_second = (dpos + xincr_first) & 63; 1214 - if ((need_second & 32) != need_second) 1215 - printk(KERN_ERR "tgafb: need_second wrong\n"); 1216 - if (left >= need_second + 64) { 1217 - left -= need_second; 1218 - n64 = left / 64; 1219 - left %= 64; 1220 - } else 1221 - need_second = 0; 1222 - } 1223 - 1224 - /* Copy trailing full 32-byte sections. This will be the main 1225 - loop if the 64 byte loop can't be used. */ 1226 - n32 = left / 32; 1227 - left %= 32; 1228 - 1229 - /* Copy the trailing unaligned destination. */ 1230 - dmask_last = (1ul << left) - 1; 1231 - 1232 - tga_regs = par->tga_regs_base; 1233 - tga_fb = par->tga_fb_base; 1234 - 1235 - /* Set up the MODE and PIXELSHIFT registers. */ 1236 - __raw_writel(TGA_MODE_SBM_8BPP|TGA_MODE_COPY, tga_regs+TGA_MODE_REG); 1237 - __raw_writel(pixel_shift, tga_regs+TGA_PIXELSHIFT_REG); 1238 - wmb(); 1239 - 1240 - for (i = 0; i < height; ++i) { 1241 - unsigned long j; 1242 - void __iomem *sfb; 1243 - void __iomem *dfb; 1244 - 1245 - sfb = tga_fb + spos; 1246 - dfb = tga_fb + dpos; 1247 - if (dmask_first) { 1248 - __raw_writel(smask_first, sfb); 1249 - wmb(); 1250 - __raw_writel(dmask_first, dfb); 1251 - wmb(); 1252 - sfb += xincr_first; 1253 - dfb += xincr_first; 1254 - } 1255 - 1256 - if (need_second) { 1257 - __raw_writel(0xffffffff, sfb); 1258 - wmb(); 1259 - __raw_writel(0xffffffff, dfb); 1260 - wmb(); 1261 - sfb += 32; 1262 - dfb += 32; 1263 - } 1264 - 1265 - if (n64 && (((unsigned long)sfb | (unsigned long)dfb) & 63)) 1266 - printk(KERN_ERR 1267 - "tgafb: misaligned copy64 (s:%p, d:%p)\n", 1268 - sfb, dfb); 1269 - 1270 - for (j = 0; j < n64; ++j) { 1271 - __raw_writel(sfb - tga_fb, tga_regs+TGA_COPY64_SRC); 1272 - wmb(); 1273 - __raw_writel(dfb - tga_fb, tga_regs+TGA_COPY64_DST); 1274 - wmb(); 1275 - sfb += 64; 1276 - dfb += 64; 1277 - } 1278 - 1279 - for (j = 0; j < n32; ++j) { 1280 - __raw_writel(0xffffffff, sfb); 1281 - wmb(); 1282 - __raw_writel(0xffffffff, dfb); 1283 - wmb(); 1284 - sfb += 32; 1285 - dfb += 32; 1286 - } 1287 - 1288 - if (dmask_last) { 1289 - __raw_writel(0xffffffff, sfb); 1290 - wmb(); 1291 - __raw_writel(dmask_last, dfb); 1292 - wmb(); 1293 - } 1294 - 1295 - spos += yincr; 1296 - dpos += yincr; 1297 - } 1298 - 1299 - /* Reset the MODE register to normal. */ 1300 - __raw_writel(TGA_MODE_SBM_8BPP|TGA_MODE_SIMPLE, tga_regs+TGA_MODE_REG); 1301 - } 1302 - 1303 1139 /* The (almost) general case of backward copy in 8bpp mode. */ 1304 1140 static inline void 1305 - copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, 1306 - u32 height, u32 width, u32 line_length, 1307 - const struct fb_copyarea *area) 1141 + copyarea_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, 1142 + u32 height, u32 width, u32 line_length, 1143 + const struct fb_copyarea *area) 1308 1144 { 1309 1145 struct tga_par *par = (struct tga_par *) info->par; 1310 - unsigned long i, left, yincr; 1311 - unsigned long depos, sepos, dealign, sealign; 1312 - u32 mask_first, mask_last; 1313 - unsigned long n32; 1146 + unsigned i, yincr; 1147 + int depos, sepos, backward, last_step, step; 1148 + u32 mask_last; 1149 + unsigned n32; 1314 1150 void __iomem *tga_regs; 1315 1151 void __iomem *tga_fb; 1316 1152 1317 - yincr = line_length; 1318 - if (dy > sy) { 1319 - dy += height - 1; 1320 - sy += height - 1; 1321 - yincr = -yincr; 1322 - } 1323 - 1324 - /* Compute the offsets and alignments in the frame buffer. 1325 - More than anything else, these control how we do copies. */ 1326 - depos = dy * line_length + dx + width; 1327 - sepos = sy * line_length + sx + width; 1328 - dealign = depos & 7; 1329 - sealign = sepos & 7; 1330 - 1331 - /* ??? The documentation appears to be incorrect (or very 1332 - misleading) wrt how pixel shifting works in backward copy 1333 - mode, i.e. when PIXELSHIFT is negative. I give up for now. 1334 - Do handle the common case of co-aligned backward copies, 1335 - but frob everything else back on generic code. */ 1336 - if (dealign != sealign) { 1153 + /* Do acceleration only if we are aligned on 8 pixels */ 1154 + if ((dx | sx | width) & 7) { 1337 1155 cfb_copyarea(info, area); 1338 1156 return; 1339 1157 } 1340 1158 1341 - /* We begin the copy with the trailing pixels of the 1342 - unaligned destination. */ 1343 - mask_first = (1ul << dealign) - 1; 1344 - left = width - dealign; 1345 - 1346 - /* Care for small copies. */ 1347 - if (dealign > width) { 1348 - mask_first ^= (1ul << (dealign - width)) - 1; 1349 - left = 0; 1159 + yincr = line_length; 1160 + if (dy > sy) { 1161 + dy += height - 1; 1162 + sy += height - 1; 1163 + yincr = -yincr; 1350 1164 } 1165 + backward = dy == sy && dx > sx && dx < sx + width; 1166 + 1167 + /* Compute the offsets and alignments in the frame buffer. 1168 + More than anything else, these control how we do copies. */ 1169 + depos = dy * line_length + dx; 1170 + sepos = sy * line_length + sx; 1171 + if (backward) 1172 + depos += width, sepos += width; 1351 1173 1352 1174 /* Next copy full words at a time. */ 1353 - n32 = left / 32; 1354 - left %= 32; 1175 + n32 = width / 32; 1176 + last_step = width % 32; 1355 1177 1356 1178 /* Finally copy the unaligned head of the span. */ 1357 - mask_last = -1 << (32 - left); 1179 + mask_last = (1ul << last_step) - 1; 1180 + 1181 + if (!backward) { 1182 + step = 32; 1183 + last_step = 32; 1184 + } else { 1185 + step = -32; 1186 + last_step = -last_step; 1187 + sepos -= 32; 1188 + depos -= 32; 1189 + } 1358 1190 1359 1191 tga_regs = par->tga_regs_base; 1360 1192 tga_fb = par->tga_fb_base; ··· 1206 1368 1207 1369 sfb = tga_fb + sepos; 1208 1370 dfb = tga_fb + depos; 1209 - if (mask_first) { 1210 - __raw_writel(mask_first, sfb); 1211 - wmb(); 1212 - __raw_writel(mask_first, dfb); 1213 - wmb(); 1214 - } 1215 1371 1216 - for (j = 0; j < n32; ++j) { 1217 - sfb -= 32; 1218 - dfb -= 32; 1372 + for (j = 0; j < n32; j++) { 1373 + if (j < 2 && j + 1 < n32 && !backward && 1374 + !(((unsigned long)sfb | (unsigned long)dfb) & 63)) { 1375 + do { 1376 + __raw_writel(sfb - tga_fb, tga_regs+TGA_COPY64_SRC); 1377 + wmb(); 1378 + __raw_writel(dfb - tga_fb, tga_regs+TGA_COPY64_DST); 1379 + wmb(); 1380 + sfb += 64; 1381 + dfb += 64; 1382 + j += 2; 1383 + } while (j + 1 < n32); 1384 + j--; 1385 + continue; 1386 + } 1219 1387 __raw_writel(0xffffffff, sfb); 1220 1388 wmb(); 1221 1389 __raw_writel(0xffffffff, dfb); 1222 1390 wmb(); 1391 + sfb += step; 1392 + dfb += step; 1223 1393 } 1224 1394 1225 1395 if (mask_last) { 1226 - sfb -= 32; 1227 - dfb -= 32; 1396 + sfb += last_step - step; 1397 + dfb += last_step - step; 1228 1398 __raw_writel(mask_last, sfb); 1229 1399 wmb(); 1230 1400 __raw_writel(mask_last, dfb); ··· 1280 1434 bpp = info->var.bits_per_pixel; 1281 1435 1282 1436 /* Detect copies of the entire line. */ 1283 - if (width * (bpp >> 3) == line_length) { 1437 + if (!(line_length & 63) && width * (bpp >> 3) == line_length) { 1284 1438 if (bpp == 8) 1285 1439 copyarea_line_8bpp(info, dy, sy, height, width); 1286 1440 else ··· 1293 1447 else if (bpp == 32) 1294 1448 cfb_copyarea(info, area); 1295 1449 1296 - /* Detect overlapping source and destination that requires 1297 - a backward copy. */ 1298 - else if (dy == sy && dx > sx && dx < sx + width) 1299 - copyarea_backward_8bpp(info, dx, dy, sx, sy, height, 1300 - width, line_length, area); 1301 1450 else 1302 - copyarea_foreward_8bpp(info, dx, dy, sx, sy, height, 1303 - width, line_length); 1451 + copyarea_8bpp(info, dx, dy, sx, sy, height, 1452 + width, line_length, area); 1304 1453 } 1305 1454 1306 1455 ··· 1311 1470 int tga_bus_tc = TGA_BUS_TC(par->dev); 1312 1471 u8 tga_type = par->tga_type; 1313 1472 const char *tga_type_name = NULL; 1473 + unsigned memory_size; 1314 1474 1315 1475 switch (tga_type) { 1316 1476 case TGA_TYPE_8PLANE: ··· 1319 1477 tga_type_name = "Digital ZLXp-E1"; 1320 1478 if (tga_bus_tc) 1321 1479 tga_type_name = "Digital ZLX-E1"; 1480 + memory_size = 2097152; 1322 1481 break; 1323 1482 case TGA_TYPE_24PLANE: 1324 1483 if (tga_bus_pci) 1325 1484 tga_type_name = "Digital ZLXp-E2"; 1326 1485 if (tga_bus_tc) 1327 1486 tga_type_name = "Digital ZLX-E2"; 1487 + memory_size = 8388608; 1328 1488 break; 1329 1489 case TGA_TYPE_24PLUSZ: 1330 1490 if (tga_bus_pci) 1331 1491 tga_type_name = "Digital ZLXp-E3"; 1332 1492 if (tga_bus_tc) 1333 1493 tga_type_name = "Digital ZLX-E3"; 1494 + memory_size = 16777216; 1334 1495 break; 1335 1496 } 1336 - if (!tga_type_name) 1497 + if (!tga_type_name) { 1337 1498 tga_type_name = "Unknown"; 1499 + memory_size = 16777216; 1500 + } 1338 1501 1339 1502 strlcpy(info->fix.id, tga_type_name, sizeof(info->fix.id)); 1340 1503 ··· 1349 1502 ? FB_VISUAL_PSEUDOCOLOR 1350 1503 : FB_VISUAL_DIRECTCOLOR); 1351 1504 1352 - info->fix.line_length = par->xres * (par->bits_per_pixel >> 3); 1353 1505 info->fix.smem_start = (size_t) par->tga_fb_base; 1354 - info->fix.smem_len = info->fix.line_length * par->yres; 1506 + info->fix.smem_len = memory_size; 1355 1507 info->fix.mmio_start = (size_t) par->tga_regs_base; 1356 1508 info->fix.mmio_len = 512; 1357 1509 ··· 1474 1628 modedb_tga = &modedb_tc; 1475 1629 modedbsize_tga = 1; 1476 1630 } 1631 + 1632 + tgafb_init_fix(info); 1633 + 1477 1634 ret = fb_find_mode(&info->var, info, 1478 1635 mode_option ? mode_option : mode_option_tga, 1479 1636 modedb_tga, modedbsize_tga, NULL, ··· 1494 1645 } 1495 1646 1496 1647 tgafb_set_par(info); 1497 - tgafb_init_fix(info); 1498 1648 1499 1649 if (register_framebuffer(info) < 0) { 1500 1650 printk(KERN_ERR "tgafb: Could not register framebuffer\n");
+4 -11
drivers/video/uvesafb.c
··· 1474 1474 * used video mode, i.e. the minimum amount of 1475 1475 * memory we need. 1476 1476 */ 1477 - if (mode != NULL) { 1478 - size_vmode = info->var.yres * mode->bytes_per_scan_line; 1479 - } else { 1480 - size_vmode = info->var.yres * info->var.xres * 1481 - ((info->var.bits_per_pixel + 7) >> 3); 1482 - } 1477 + size_vmode = info->var.yres * mode->bytes_per_scan_line; 1483 1478 1484 1479 /* 1485 1480 * size_total -- all video memory we have. Used for mtrr ··· 1807 1812 fb_destroy_modedb(info->monspecs.modedb); 1808 1813 fb_dealloc_cmap(&info->cmap); 1809 1814 1810 - if (par) { 1811 - kfree(par->vbe_modes); 1812 - kfree(par->vbe_state_orig); 1813 - kfree(par->vbe_state_saved); 1814 - } 1815 + kfree(par->vbe_modes); 1816 + kfree(par->vbe_state_orig); 1817 + kfree(par->vbe_state_saved); 1815 1818 1816 1819 framebuffer_release(info); 1817 1820 }
+12 -1
drivers/video/vesafb.c
··· 179 179 if (info->screen_base) 180 180 iounmap(info->screen_base); 181 181 release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); 182 - framebuffer_release(info); 183 182 } 184 183 185 184 static struct fb_ops vesafb_ops = { ··· 296 297 release_mem_region(vesafb_fix.smem_start, size_total); 297 298 return -ENOMEM; 298 299 } 300 + platform_set_drvdata(dev, info); 299 301 info->pseudo_palette = info->par; 300 302 info->par = NULL; 301 303 ··· 499 499 return err; 500 500 } 501 501 502 + static int vesafb_remove(struct platform_device *pdev) 503 + { 504 + struct fb_info *info = platform_get_drvdata(pdev); 505 + 506 + unregister_framebuffer(info); 507 + framebuffer_release(info); 508 + 509 + return 0; 510 + } 511 + 502 512 static struct platform_driver vesafb_driver = { 503 513 .driver = { 504 514 .name = "vesa-framebuffer", 505 515 .owner = THIS_MODULE, 506 516 }, 507 517 .probe = vesafb_probe, 518 + .remove = vesafb_remove, 508 519 }; 509 520 510 521 module_platform_driver(vesafb_driver);
+14 -1
drivers/video/xilinxfb.c
··· 33 33 #include <linux/of_platform.h> 34 34 #include <linux/of_address.h> 35 35 #include <linux/io.h> 36 - #include <linux/xilinxfb.h> 37 36 #include <linux/slab.h> 38 37 39 38 #ifdef CONFIG_PPC_DCR ··· 82 83 #define BLUE_SHIFT 0 83 84 84 85 #define PALETTE_ENTRIES_NO 16 /* passed to fb_alloc_cmap() */ 86 + 87 + /* ML300/403 reference design framebuffer driver platform data struct */ 88 + struct xilinxfb_platform_data { 89 + u32 rotate_screen; /* Flag to rotate display 180 degrees */ 90 + u32 screen_height_mm; /* Physical dimensions of screen in mm */ 91 + u32 screen_width_mm; 92 + u32 xres, yres; /* resolution of screen in pixels */ 93 + u32 xvirt, yvirt; /* resolution of memory buffer */ 94 + 95 + /* Physical address of framebuffer memory; If non-zero, driver 96 + * will use provided memory address instead of allocating one from 97 + * the consistent pool. */ 98 + u32 fb_phys; 99 + }; 85 100 86 101 /* 87 102 * Default xilinxfb configuration
-12
include/linux/platform_data/video-imxfb.h
··· 61 61 struct imx_fb_videomode *mode; 62 62 int num_modes; 63 63 64 - u_int cmap_greyscale:1, 65 - cmap_inverse:1, 66 - cmap_static:1, 67 - unused:29; 68 - 69 64 u_int pwmr; 70 65 u_int lscr1; 71 66 u_int dmacr; 72 67 73 - u_char * fixed_screen_cpu; 74 - dma_addr_t fixed_screen_dma; 75 - 76 68 int (*init)(struct platform_device *); 77 69 void (*exit)(struct platform_device *); 78 - 79 - void (*lcd_power)(int); 80 - void (*backlight_power)(int); 81 70 }; 82 71 83 - void set_imx_fb_info(struct imx_fb_platform_data *); 84 72 #endif /* ifndef __MACH_IMXFB_H__ */
-30
include/linux/xilinxfb.h
··· 1 - /* 2 - * Platform device data for Xilinx Framebuffer device 3 - * 4 - * Copyright 2007 Secret Lab Technologies Ltd. 5 - * 6 - * This file is licensed under the terms of the GNU General Public License 7 - * version 2. This program is licensed "as is" without any warranty of any 8 - * kind, whether express or implied. 9 - */ 10 - 11 - #ifndef __XILINXFB_H__ 12 - #define __XILINXFB_H__ 13 - 14 - #include <linux/types.h> 15 - 16 - /* ML300/403 reference design framebuffer driver platform data struct */ 17 - struct xilinxfb_platform_data { 18 - u32 rotate_screen; /* Flag to rotate display 180 degrees */ 19 - u32 screen_height_mm; /* Physical dimensions of screen in mm */ 20 - u32 screen_width_mm; 21 - u32 xres, yres; /* resolution of screen in pixels */ 22 - u32 xvirt, yvirt; /* resolution of memory buffer */ 23 - 24 - /* Physical address of framebuffer memory; If non-zero, driver 25 - * will use provided memory address instead of allocating one from 26 - * the consistent pool. */ 27 - u32 fb_phys; 28 - }; 29 - 30 - #endif /* __XILINXFB_H__ */
+2 -3
include/video/omapdss.h
··· 323 323 324 324 /* Board specific data */ 325 325 struct omap_dss_board_info { 326 - int (*get_context_loss_count)(struct device *dev); 327 326 int num_devices; 328 327 struct omap_dss_device **devices; 329 328 struct omap_dss_device *default_device; ··· 343 344 u16 x_res; 344 345 /* Unit: pixels */ 345 346 u16 y_res; 346 - /* Unit: KHz */ 347 - u32 pixel_clock; 347 + /* Unit: Hz */ 348 + u32 pixelclock; 348 349 /* Unit: pixel clocks */ 349 350 u16 hsw; /* Horizontal synchronization pulse width */ 350 351 /* Unit: pixel clocks */