diff options
-rw-r--r-- | drivers/video/console/dummycon.c | 1 | ||||
-rw-r--r-- | drivers/video/fbdev/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/fbdev/atmel_lcdfb.c | 8 | ||||
-rw-r--r-- | drivers/video/fbdev/aty/radeon_base.c | 18 | ||||
-rw-r--r-- | drivers/video/fbdev/au1200fb.h | 286 | ||||
-rw-r--r-- | drivers/video/fbdev/auo_k190x.c | 3 | ||||
-rw-r--r-- | drivers/video/fbdev/mmp/core.c | 5 | ||||
-rw-r--r-- | drivers/video/fbdev/mxsfb.c | 45 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 39 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/omapfb/dss/dss.c | 45 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 5 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c | 31 | ||||
-rw-r--r-- | drivers/video/fbdev/pxa3xx-gcu.c | 16 | ||||
-rw-r--r-- | drivers/video/fbdev/smscufx.c | 5 | ||||
-rw-r--r-- | drivers/video/fbdev/udlfb.c | 655 | ||||
-rw-r--r-- | drivers/video/fbdev/vfb.c | 17 | ||||
-rw-r--r-- | drivers/video/fbdev/vga16fb.c | 1 | ||||
-rw-r--r-- | drivers/video/fbdev/vt8500lcdfb.c | 4 | ||||
-rw-r--r-- | drivers/video/fbdev/wm8505fb.c | 4 | ||||
-rw-r--r-- | include/linux/fb.h | 5 | ||||
-rw-r--r-- | include/video/udlfb.h | 3 |
21 files changed, 421 insertions, 777 deletions
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c index 9269d5685239..b90ef96e43d6 100644 --- a/drivers/video/console/dummycon.c +++ b/drivers/video/console/dummycon.c | |||
@@ -67,7 +67,6 @@ const struct consw dummy_con = { | |||
67 | .con_switch = DUMMY, | 67 | .con_switch = DUMMY, |
68 | .con_blank = DUMMY, | 68 | .con_blank = DUMMY, |
69 | .con_font_set = DUMMY, | 69 | .con_font_set = DUMMY, |
70 | .con_font_get = DUMMY, | ||
71 | .con_font_default = DUMMY, | 70 | .con_font_default = DUMMY, |
72 | .con_font_copy = DUMMY, | 71 | .con_font_copy = DUMMY, |
73 | }; | 72 | }; |
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 2566cfbdebfb..6962b4583fd7 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig | |||
@@ -1188,7 +1188,7 @@ config FB_INTEL | |||
1188 | 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. | 1188 | 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. |
1189 | Say Y if you have and plan to use such a board. | 1189 | Say Y if you have and plan to use such a board. |
1190 | 1190 | ||
1191 | To make FB_INTELFB=Y work you need to say AGP_INTEL=y too. | 1191 | To make FB_INTEL=Y work you need to say AGP_INTEL=y too. |
1192 | 1192 | ||
1193 | To compile this driver as a module, choose M here: the | 1193 | To compile this driver as a module, choose M here: the |
1194 | module will be called intelfb. | 1194 | module will be called intelfb. |
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index e06358da4b99..3dee267d7c75 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c | |||
@@ -1119,7 +1119,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) | |||
1119 | goto put_display_node; | 1119 | goto put_display_node; |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | timings_np = of_find_node_by_name(display_np, "display-timings"); | 1122 | timings_np = of_get_child_by_name(display_np, "display-timings"); |
1123 | if (!timings_np) { | 1123 | if (!timings_np) { |
1124 | dev_err(dev, "failed to find display-timings node\n"); | 1124 | dev_err(dev, "failed to find display-timings node\n"); |
1125 | ret = -ENODEV; | 1125 | ret = -ENODEV; |
@@ -1140,6 +1140,12 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) | |||
1140 | fb_add_videomode(&fb_vm, &info->modelist); | 1140 | fb_add_videomode(&fb_vm, &info->modelist); |
1141 | } | 1141 | } |
1142 | 1142 | ||
1143 | /* | ||
1144 | * FIXME: Make sure we are not referencing any fields in display_np | ||
1145 | * and timings_np and drop our references to them before returning to | ||
1146 | * avoid leaking the nodes on probe deferral and driver unbind. | ||
1147 | */ | ||
1148 | |||
1143 | return 0; | 1149 | return 0; |
1144 | 1150 | ||
1145 | put_timings_node: | 1151 | put_timings_node: |
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 4d77daeecf99..87608c0b2351 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c | |||
@@ -583,8 +583,8 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo) | |||
583 | int hTotal, vTotal, num, denom, m, n; | 583 | int hTotal, vTotal, num, denom, m, n; |
584 | unsigned long long hz, vclk; | 584 | unsigned long long hz, vclk; |
585 | long xtal; | 585 | long xtal; |
586 | struct timeval start_tv, stop_tv; | 586 | ktime_t start_time, stop_time; |
587 | long total_secs, total_usecs; | 587 | u64 total_usecs; |
588 | int i; | 588 | int i; |
589 | 589 | ||
590 | /* Ugh, we cut interrupts, bad bad bad, but we want some precision | 590 | /* Ugh, we cut interrupts, bad bad bad, but we want some precision |
@@ -600,7 +600,7 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo) | |||
600 | if (((INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3ff) == 0) | 600 | if (((INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3ff) == 0) |
601 | break; | 601 | break; |
602 | 602 | ||
603 | do_gettimeofday(&start_tv); | 603 | start_time = ktime_get(); |
604 | 604 | ||
605 | for(i=0; i<1000000; i++) | 605 | for(i=0; i<1000000; i++) |
606 | if (((INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3ff) != 0) | 606 | if (((INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3ff) != 0) |
@@ -610,18 +610,14 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo) | |||
610 | if (((INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3ff) == 0) | 610 | if (((INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3ff) == 0) |
611 | break; | 611 | break; |
612 | 612 | ||
613 | do_gettimeofday(&stop_tv); | 613 | stop_time = ktime_get(); |
614 | 614 | ||
615 | local_irq_enable(); | 615 | local_irq_enable(); |
616 | 616 | ||
617 | total_secs = stop_tv.tv_sec - start_tv.tv_sec; | 617 | total_usecs = ktime_us_delta(stop_time, start_time); |
618 | if (total_secs > 10) | 618 | if (total_usecs >= 10 * USEC_PER_SEC || total_usecs == 0) |
619 | return -1; | 619 | return -1; |
620 | total_usecs = stop_tv.tv_usec - start_tv.tv_usec; | 620 | hz = USEC_PER_SEC/(u32)total_usecs; |
621 | total_usecs += total_secs * 1000000; | ||
622 | if (total_usecs < 0) | ||
623 | total_usecs = -total_usecs; | ||
624 | hz = 1000000/total_usecs; | ||
625 | 621 | ||
626 | hTotal = ((INREG(CRTC_H_TOTAL_DISP) & 0x1ff) + 1) * 8; | 622 | hTotal = ((INREG(CRTC_H_TOTAL_DISP) & 0x1ff) + 1) * 8; |
627 | vTotal = ((INREG(CRTC_V_TOTAL_DISP) & 0x3ff) + 1); | 623 | vTotal = ((INREG(CRTC_V_TOTAL_DISP) & 0x3ff) + 1); |
diff --git a/drivers/video/fbdev/au1200fb.h b/drivers/video/fbdev/au1200fb.h index e2672714d8d4..b34fff342a1a 100644 --- a/drivers/video/fbdev/au1200fb.h +++ b/drivers/video/fbdev/au1200fb.h | |||
@@ -284,289 +284,3 @@ struct au1200_lcd { | |||
284 | 284 | ||
285 | /********************************************************************/ | 285 | /********************************************************************/ |
286 | #endif /* _AU1200LCD_H */ | 286 | #endif /* _AU1200LCD_H */ |
287 | /* | ||
288 | * BRIEF MODULE DESCRIPTION | ||
289 | * Hardware definitions for the Au1200 LCD controller | ||
290 | * | ||
291 | * Copyright 2004 AMD | ||
292 | * Author: AMD | ||
293 | * | ||
294 | * This program is free software; you can redistribute it and/or modify it | ||
295 | * under the terms of the GNU General Public License as published by the | ||
296 | * Free Software Foundation; either version 2 of the License, or (at your | ||
297 | * option) any later version. | ||
298 | * | ||
299 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
300 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
301 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
302 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
303 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
304 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
305 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
306 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
307 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
308 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
309 | * | ||
310 | * You should have received a copy of the GNU General Public License along | ||
311 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
312 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
313 | */ | ||
314 | |||
315 | #ifndef _AU1200LCD_H | ||
316 | #define _AU1200LCD_H | ||
317 | |||
318 | /********************************************************************/ | ||
319 | #define AU1200_LCD_ADDR 0xB5000000 | ||
320 | |||
321 | #define uint8 unsigned char | ||
322 | #define uint32 unsigned int | ||
323 | |||
324 | struct au1200_lcd { | ||
325 | volatile uint32 reserved0; | ||
326 | volatile uint32 screen; | ||
327 | volatile uint32 backcolor; | ||
328 | volatile uint32 horztiming; | ||
329 | volatile uint32 verttiming; | ||
330 | volatile uint32 clkcontrol; | ||
331 | volatile uint32 pwmdiv; | ||
332 | volatile uint32 pwmhi; | ||
333 | volatile uint32 reserved1; | ||
334 | volatile uint32 winenable; | ||
335 | volatile uint32 colorkey; | ||
336 | volatile uint32 colorkeymsk; | ||
337 | struct | ||
338 | { | ||
339 | volatile uint32 cursorctrl; | ||
340 | volatile uint32 cursorpos; | ||
341 | volatile uint32 cursorcolor0; | ||
342 | volatile uint32 cursorcolor1; | ||
343 | volatile uint32 cursorcolor2; | ||
344 | uint32 cursorcolor3; | ||
345 | } hwc; | ||
346 | volatile uint32 intstatus; | ||
347 | volatile uint32 intenable; | ||
348 | volatile uint32 outmask; | ||
349 | volatile uint32 fifoctrl; | ||
350 | uint32 reserved2[(0x0100-0x0058)/4]; | ||
351 | struct | ||
352 | { | ||
353 | volatile uint32 winctrl0; | ||
354 | volatile uint32 winctrl1; | ||
355 | volatile uint32 winctrl2; | ||
356 | volatile uint32 winbuf0; | ||
357 | volatile uint32 winbuf1; | ||
358 | volatile uint32 winbufctrl; | ||
359 | uint32 winreserved0; | ||
360 | uint32 winreserved1; | ||
361 | } window[4]; | ||
362 | |||
363 | uint32 reserved3[(0x0400-0x0180)/4]; | ||
364 | |||
365 | volatile uint32 palette[(0x0800-0x0400)/4]; | ||
366 | |||
367 | volatile uint8 cursorpattern[256]; | ||
368 | }; | ||
369 | |||
370 | /* lcd_screen */ | ||
371 | #define LCD_SCREEN_SEN (1<<31) | ||
372 | #define LCD_SCREEN_SX (0x07FF<<19) | ||
373 | #define LCD_SCREEN_SY (0x07FF<< 8) | ||
374 | #define LCD_SCREEN_SWP (1<<7) | ||
375 | #define LCD_SCREEN_SWD (1<<6) | ||
376 | #define LCD_SCREEN_PT (7<<0) | ||
377 | #define LCD_SCREEN_PT_TFT (0<<0) | ||
378 | #define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19) | ||
379 | #define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8) | ||
380 | #define LCD_SCREEN_PT_CSTN (1<<0) | ||
381 | #define LCD_SCREEN_PT_CDSTN (2<<0) | ||
382 | #define LCD_SCREEN_PT_M8STN (3<<0) | ||
383 | #define LCD_SCREEN_PT_M4STN (4<<0) | ||
384 | |||
385 | /* lcd_backcolor */ | ||
386 | #define LCD_BACKCOLOR_SBGR (0xFF<<16) | ||
387 | #define LCD_BACKCOLOR_SBGG (0xFF<<8) | ||
388 | #define LCD_BACKCOLOR_SBGB (0xFF<<0) | ||
389 | #define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16) | ||
390 | #define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8) | ||
391 | #define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0) | ||
392 | |||
393 | /* lcd_winenable */ | ||
394 | #define LCD_WINENABLE_WEN3 (1<<3) | ||
395 | #define LCD_WINENABLE_WEN2 (1<<2) | ||
396 | #define LCD_WINENABLE_WEN1 (1<<1) | ||
397 | #define LCD_WINENABLE_WEN0 (1<<0) | ||
398 | |||
399 | /* lcd_colorkey */ | ||
400 | #define LCD_COLORKEY_CKR (0xFF<<16) | ||
401 | #define LCD_COLORKEY_CKG (0xFF<<8) | ||
402 | #define LCD_COLORKEY_CKB (0xFF<<0) | ||
403 | #define LCD_COLORKEY_CKR_N(N) ((N)<<16) | ||
404 | #define LCD_COLORKEY_CKG_N(N) ((N)<<8) | ||
405 | #define LCD_COLORKEY_CKB_N(N) ((N)<<0) | ||
406 | |||
407 | /* lcd_colorkeymsk */ | ||
408 | #define LCD_COLORKEYMSK_CKMR (0xFF<<16) | ||
409 | #define LCD_COLORKEYMSK_CKMG (0xFF<<8) | ||
410 | #define LCD_COLORKEYMSK_CKMB (0xFF<<0) | ||
411 | #define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16) | ||
412 | #define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8) | ||
413 | #define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0) | ||
414 | |||
415 | /* lcd windows control 0 */ | ||
416 | #define LCD_WINCTRL0_OX (0x07FF<<21) | ||
417 | #define LCD_WINCTRL0_OY (0x07FF<<10) | ||
418 | #define LCD_WINCTRL0_A (0x00FF<<2) | ||
419 | #define LCD_WINCTRL0_AEN (1<<1) | ||
420 | #define LCD_WINCTRL0_OX_N(N) ((N)<<21) | ||
421 | #define LCD_WINCTRL0_OY_N(N) ((N)<<10) | ||
422 | #define LCD_WINCTRL0_A_N(N) ((N)<<2) | ||
423 | |||
424 | /* lcd windows control 1 */ | ||
425 | #define LCD_WINCTRL1_PRI (3<<30) | ||
426 | #define LCD_WINCTRL1_PIPE (1<<29) | ||
427 | #define LCD_WINCTRL1_FRM (0xF<<25) | ||
428 | #define LCD_WINCTRL1_CCO (1<<24) | ||
429 | #define LCD_WINCTRL1_PO (3<<22) | ||
430 | #define LCD_WINCTRL1_SZX (0x07FF<<11) | ||
431 | #define LCD_WINCTRL1_SZY (0x07FF<<0) | ||
432 | #define LCD_WINCTRL1_FRM_1BPP (0<<25) | ||
433 | #define LCD_WINCTRL1_FRM_2BPP (1<<25) | ||
434 | #define LCD_WINCTRL1_FRM_4BPP (2<<25) | ||
435 | #define LCD_WINCTRL1_FRM_8BPP (3<<25) | ||
436 | #define LCD_WINCTRL1_FRM_12BPP (4<<25) | ||
437 | #define LCD_WINCTRL1_FRM_16BPP655 (5<<25) | ||
438 | #define LCD_WINCTRL1_FRM_16BPP565 (6<<25) | ||
439 | #define LCD_WINCTRL1_FRM_16BPP556 (7<<25) | ||
440 | #define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25) | ||
441 | #define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25) | ||
442 | #define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25) | ||
443 | #define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25) | ||
444 | #define LCD_WINCTRL1_FRM_24BPP (12<<25) | ||
445 | #define LCD_WINCTRL1_FRM_32BPP (13<<25) | ||
446 | #define LCD_WINCTRL1_PRI_N(N) ((N)<<30) | ||
447 | #define LCD_WINCTRL1_PO_00 (0<<22) | ||
448 | #define LCD_WINCTRL1_PO_01 (1<<22) | ||
449 | #define LCD_WINCTRL1_PO_10 (2<<22) | ||
450 | #define LCD_WINCTRL1_PO_11 (3<<22) | ||
451 | #define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11) | ||
452 | #define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0) | ||
453 | |||
454 | /* lcd windows control 2 */ | ||
455 | #define LCD_WINCTRL2_CKMODE (3<<24) | ||
456 | #define LCD_WINCTRL2_DBM (1<<23) | ||
457 | #define LCD_WINCTRL2_RAM (3<<21) | ||
458 | #define LCD_WINCTRL2_BX (0x1FFF<<8) | ||
459 | #define LCD_WINCTRL2_SCX (0xF<<4) | ||
460 | #define LCD_WINCTRL2_SCY (0xF<<0) | ||
461 | #define LCD_WINCTRL2_CKMODE_00 (0<<24) | ||
462 | #define LCD_WINCTRL2_CKMODE_01 (1<<24) | ||
463 | #define LCD_WINCTRL2_CKMODE_10 (2<<24) | ||
464 | #define LCD_WINCTRL2_CKMODE_11 (3<<24) | ||
465 | #define LCD_WINCTRL2_RAM_NONE (0<<21) | ||
466 | #define LCD_WINCTRL2_RAM_PALETTE (1<<21) | ||
467 | #define LCD_WINCTRL2_RAM_GAMMA (2<<21) | ||
468 | #define LCD_WINCTRL2_RAM_BUFFER (3<<21) | ||
469 | #define LCD_WINCTRL2_BX_N(N) ((N)<<8) | ||
470 | #define LCD_WINCTRL2_SCX_1 (0<<4) | ||
471 | #define LCD_WINCTRL2_SCX_2 (1<<4) | ||
472 | #define LCD_WINCTRL2_SCX_4 (2<<4) | ||
473 | #define LCD_WINCTRL2_SCY_1 (0<<0) | ||
474 | #define LCD_WINCTRL2_SCY_2 (1<<0) | ||
475 | #define LCD_WINCTRL2_SCY_4 (2<<0) | ||
476 | |||
477 | /* lcd windows buffer control */ | ||
478 | #define LCD_WINBUFCTRL_DB (1<<1) | ||
479 | #define LCD_WINBUFCTRL_DBN (1<<0) | ||
480 | |||
481 | /* lcd_intstatus, lcd_intenable */ | ||
482 | #define LCD_INT_IFO (0xF<<14) | ||
483 | #define LCD_INT_IFU (0xF<<10) | ||
484 | #define LCD_INT_OFO (1<<9) | ||
485 | #define LCD_INT_OFU (1<<8) | ||
486 | #define LCD_INT_WAIT (1<<3) | ||
487 | #define LCD_INT_SD (1<<2) | ||
488 | #define LCD_INT_SA (1<<1) | ||
489 | #define LCD_INT_SS (1<<0) | ||
490 | |||
491 | /* lcd_horztiming */ | ||
492 | #define LCD_HORZTIMING_HND2 (0x1FF<<18) | ||
493 | #define LCD_HORZTIMING_HND1 (0x1FF<<9) | ||
494 | #define LCD_HORZTIMING_HPW (0x1FF<<0) | ||
495 | #define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18) | ||
496 | #define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9) | ||
497 | #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0) | ||
498 | |||
499 | /* lcd_verttiming */ | ||
500 | #define LCD_VERTTIMING_VND2 (0x1FF<<18) | ||
501 | #define LCD_VERTTIMING_VND1 (0x1FF<<9) | ||
502 | #define LCD_VERTTIMING_VPW (0x1FF<<0) | ||
503 | #define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18) | ||
504 | #define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9) | ||
505 | #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0) | ||
506 | |||
507 | /* lcd_clkcontrol */ | ||
508 | #define LCD_CLKCONTROL_EXT (1<<22) | ||
509 | #define LCD_CLKCONTROL_DELAY (3<<20) | ||
510 | #define LCD_CLKCONTROL_CDD (1<<19) | ||
511 | #define LCD_CLKCONTROL_IB (1<<18) | ||
512 | #define LCD_CLKCONTROL_IC (1<<17) | ||
513 | #define LCD_CLKCONTROL_IH (1<<16) | ||
514 | #define LCD_CLKCONTROL_IV (1<<15) | ||
515 | #define LCD_CLKCONTROL_BF (0x1F<<10) | ||
516 | #define LCD_CLKCONTROL_PCD (0x3FF<<0) | ||
517 | #define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10) | ||
518 | #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0) | ||
519 | |||
520 | /* lcd_pwmdiv */ | ||
521 | #define LCD_PWMDIV_EN (1<<31) | ||
522 | #define LCD_PWMDIV_PWMDIV (0x1FFFF<<0) | ||
523 | #define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0) | ||
524 | |||
525 | /* lcd_pwmhi */ | ||
526 | #define LCD_PWMHI_PWMHI1 (0xFFFF<<16) | ||
527 | #define LCD_PWMHI_PWMHI0 (0xFFFF<<0) | ||
528 | #define LCD_PWMHI_PWMHI1_N(N) ((N)<<16) | ||
529 | #define LCD_PWMHI_PWMHI0_N(N) ((N)<<0) | ||
530 | |||
531 | /* lcd_hwccon */ | ||
532 | #define LCD_HWCCON_EN (1<<0) | ||
533 | |||
534 | /* lcd_cursorpos */ | ||
535 | #define LCD_CURSORPOS_HWCXOFF (0x1F<<27) | ||
536 | #define LCD_CURSORPOS_HWCXPOS (0x07FF<<16) | ||
537 | #define LCD_CURSORPOS_HWCYOFF (0x1F<<11) | ||
538 | #define LCD_CURSORPOS_HWCYPOS (0x07FF<<0) | ||
539 | #define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27) | ||
540 | #define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16) | ||
541 | #define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11) | ||
542 | #define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0) | ||
543 | |||
544 | /* lcd_cursorcolor */ | ||
545 | #define LCD_CURSORCOLOR_HWCA (0xFF<<24) | ||
546 | #define LCD_CURSORCOLOR_HWCR (0xFF<<16) | ||
547 | #define LCD_CURSORCOLOR_HWCG (0xFF<<8) | ||
548 | #define LCD_CURSORCOLOR_HWCB (0xFF<<0) | ||
549 | #define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24) | ||
550 | #define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16) | ||
551 | #define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8) | ||
552 | #define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0) | ||
553 | |||
554 | /* lcd_fifoctrl */ | ||
555 | #define LCD_FIFOCTRL_F3IF (1<<29) | ||
556 | #define LCD_FIFOCTRL_F3REQ (0x1F<<24) | ||
557 | #define LCD_FIFOCTRL_F2IF (1<<29) | ||
558 | #define LCD_FIFOCTRL_F2REQ (0x1F<<16) | ||
559 | #define LCD_FIFOCTRL_F1IF (1<<29) | ||
560 | #define LCD_FIFOCTRL_F1REQ (0x1F<<8) | ||
561 | #define LCD_FIFOCTRL_F0IF (1<<29) | ||
562 | #define LCD_FIFOCTRL_F0REQ (0x1F<<0) | ||
563 | #define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24) | ||
564 | #define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16) | ||
565 | #define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8) | ||
566 | #define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0) | ||
567 | |||
568 | /* lcd_outmask */ | ||
569 | #define LCD_OUTMASK_MASK (0x00FFFFFF) | ||
570 | |||
571 | /********************************************************************/ | ||
572 | #endif /* _AU1200LCD_H */ | ||
diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c index 1e383c547633..9d24d1b3e9ef 100644 --- a/drivers/video/fbdev/auo_k190x.c +++ b/drivers/video/fbdev/auo_k190x.c | |||
@@ -1056,13 +1056,12 @@ int auok190x_common_probe(struct platform_device *pdev, | |||
1056 | /* videomemory handling */ | 1056 | /* videomemory handling */ |
1057 | 1057 | ||
1058 | videomemorysize = roundup((panel->w * panel->h) * 2, PAGE_SIZE); | 1058 | videomemorysize = roundup((panel->w * panel->h) * 2, PAGE_SIZE); |
1059 | videomemory = vmalloc(videomemorysize); | 1059 | videomemory = vzalloc(videomemorysize); |
1060 | if (!videomemory) { | 1060 | if (!videomemory) { |
1061 | ret = -ENOMEM; | 1061 | ret = -ENOMEM; |
1062 | goto err_irq; | 1062 | goto err_irq; |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | memset(videomemory, 0, videomemorysize); | ||
1066 | info->screen_base = (char *)videomemory; | 1065 | info->screen_base = (char *)videomemory; |
1067 | info->fix.smem_len = videomemorysize; | 1066 | info->fix.smem_len = videomemorysize; |
1068 | 1067 | ||
diff --git a/drivers/video/fbdev/mmp/core.c b/drivers/video/fbdev/mmp/core.c index a0f496049db7..3a6bb6561ba0 100644 --- a/drivers/video/fbdev/mmp/core.c +++ b/drivers/video/fbdev/mmp/core.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
25 | #include <linux/export.h> | 25 | #include <linux/export.h> |
26 | #include <linux/module.h> | ||
26 | #include <video/mmp_disp.h> | 27 | #include <video/mmp_disp.h> |
27 | 28 | ||
28 | static struct mmp_overlay *path_get_overlay(struct mmp_path *path, | 29 | static struct mmp_overlay *path_get_overlay(struct mmp_path *path, |
@@ -249,3 +250,7 @@ void mmp_unregister_path(struct mmp_path *path) | |||
249 | mutex_unlock(&disp_lock); | 250 | mutex_unlock(&disp_lock); |
250 | } | 251 | } |
251 | EXPORT_SYMBOL_GPL(mmp_unregister_path); | 252 | EXPORT_SYMBOL_GPL(mmp_unregister_path); |
253 | |||
254 | MODULE_AUTHOR("Zhou Zhu <zzhu3@marvell.com>"); | ||
255 | MODULE_DESCRIPTION("Marvell MMP display framework"); | ||
256 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c index 79b1dc7f042b..246bea3a7d9b 100644 --- a/drivers/video/fbdev/mxsfb.c +++ b/drivers/video/fbdev/mxsfb.c | |||
@@ -169,7 +169,6 @@ struct mxsfb_devdata { | |||
169 | }; | 169 | }; |
170 | 170 | ||
171 | struct mxsfb_info { | 171 | struct mxsfb_info { |
172 | struct fb_info fb_info; | ||
173 | struct platform_device *pdev; | 172 | struct platform_device *pdev; |
174 | struct clk *clk; | 173 | struct clk *clk; |
175 | struct clk *clk_axi; | 174 | struct clk *clk_axi; |
@@ -208,8 +207,6 @@ static const struct mxsfb_devdata mxsfb_devdata[] = { | |||
208 | }, | 207 | }, |
209 | }; | 208 | }; |
210 | 209 | ||
211 | #define to_imxfb_host(x) (container_of(x, struct mxsfb_info, fb_info)) | ||
212 | |||
213 | /* mask and shift depends on architecture */ | 210 | /* mask and shift depends on architecture */ |
214 | static inline u32 set_hsync_pulse_width(struct mxsfb_info *host, unsigned val) | 211 | static inline u32 set_hsync_pulse_width(struct mxsfb_info *host, unsigned val) |
215 | { | 212 | { |
@@ -269,7 +266,7 @@ static inline unsigned chan_to_field(unsigned chan, struct fb_bitfield *bf) | |||
269 | static int mxsfb_check_var(struct fb_var_screeninfo *var, | 266 | static int mxsfb_check_var(struct fb_var_screeninfo *var, |
270 | struct fb_info *fb_info) | 267 | struct fb_info *fb_info) |
271 | { | 268 | { |
272 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 269 | struct mxsfb_info *host = fb_info->par; |
273 | const struct fb_bitfield *rgb = NULL; | 270 | const struct fb_bitfield *rgb = NULL; |
274 | 271 | ||
275 | if (var->xres < MIN_XRES) | 272 | if (var->xres < MIN_XRES) |
@@ -330,7 +327,7 @@ static inline void mxsfb_disable_axi_clk(struct mxsfb_info *host) | |||
330 | 327 | ||
331 | static void mxsfb_enable_controller(struct fb_info *fb_info) | 328 | static void mxsfb_enable_controller(struct fb_info *fb_info) |
332 | { | 329 | { |
333 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 330 | struct mxsfb_info *host = fb_info->par; |
334 | u32 reg; | 331 | u32 reg; |
335 | int ret; | 332 | int ret; |
336 | 333 | ||
@@ -367,7 +364,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info) | |||
367 | 364 | ||
368 | static void mxsfb_disable_controller(struct fb_info *fb_info) | 365 | static void mxsfb_disable_controller(struct fb_info *fb_info) |
369 | { | 366 | { |
370 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 367 | struct mxsfb_info *host = fb_info->par; |
371 | unsigned loop; | 368 | unsigned loop; |
372 | u32 reg; | 369 | u32 reg; |
373 | int ret; | 370 | int ret; |
@@ -409,7 +406,7 @@ static void mxsfb_disable_controller(struct fb_info *fb_info) | |||
409 | 406 | ||
410 | static int mxsfb_set_par(struct fb_info *fb_info) | 407 | static int mxsfb_set_par(struct fb_info *fb_info) |
411 | { | 408 | { |
412 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 409 | struct mxsfb_info *host = fb_info->par; |
413 | u32 ctrl, vdctrl0, vdctrl4; | 410 | u32 ctrl, vdctrl0, vdctrl4; |
414 | int line_size, fb_size; | 411 | int line_size, fb_size; |
415 | int reenable = 0; | 412 | int reenable = 0; |
@@ -569,7 +566,7 @@ static int mxsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
569 | 566 | ||
570 | static int mxsfb_blank(int blank, struct fb_info *fb_info) | 567 | static int mxsfb_blank(int blank, struct fb_info *fb_info) |
571 | { | 568 | { |
572 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 569 | struct mxsfb_info *host = fb_info->par; |
573 | 570 | ||
574 | switch (blank) { | 571 | switch (blank) { |
575 | case FB_BLANK_POWERDOWN: | 572 | case FB_BLANK_POWERDOWN: |
@@ -591,7 +588,7 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info) | |||
591 | static int mxsfb_pan_display(struct fb_var_screeninfo *var, | 588 | static int mxsfb_pan_display(struct fb_var_screeninfo *var, |
592 | struct fb_info *fb_info) | 589 | struct fb_info *fb_info) |
593 | { | 590 | { |
594 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 591 | struct mxsfb_info *host = fb_info->par; |
595 | unsigned offset; | 592 | unsigned offset; |
596 | 593 | ||
597 | if (var->xoffset != 0) | 594 | if (var->xoffset != 0) |
@@ -622,10 +619,10 @@ static struct fb_ops mxsfb_ops = { | |||
622 | .fb_imageblit = cfb_imageblit, | 619 | .fb_imageblit = cfb_imageblit, |
623 | }; | 620 | }; |
624 | 621 | ||
625 | static int mxsfb_restore_mode(struct mxsfb_info *host, | 622 | static int mxsfb_restore_mode(struct fb_info *fb_info, |
626 | struct fb_videomode *vmode) | 623 | struct fb_videomode *vmode) |
627 | { | 624 | { |
628 | struct fb_info *fb_info = &host->fb_info; | 625 | struct mxsfb_info *host = fb_info->par; |
629 | unsigned line_count; | 626 | unsigned line_count; |
630 | unsigned period; | 627 | unsigned period; |
631 | unsigned long pa, fbsize; | 628 | unsigned long pa, fbsize; |
@@ -726,10 +723,10 @@ err: | |||
726 | return ret; | 723 | return ret; |
727 | } | 724 | } |
728 | 725 | ||
729 | static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host, | 726 | static int mxsfb_init_fbinfo_dt(struct fb_info *fb_info, |
730 | struct fb_videomode *vmode) | 727 | struct fb_videomode *vmode) |
731 | { | 728 | { |
732 | struct fb_info *fb_info = &host->fb_info; | 729 | struct mxsfb_info *host = fb_info->par; |
733 | struct fb_var_screeninfo *var = &fb_info->var; | 730 | struct fb_var_screeninfo *var = &fb_info->var; |
734 | struct device *dev = &host->pdev->dev; | 731 | struct device *dev = &host->pdev->dev; |
735 | struct device_node *np = host->pdev->dev.of_node; | 732 | struct device_node *np = host->pdev->dev.of_node; |
@@ -805,12 +802,12 @@ put_display_node: | |||
805 | return ret; | 802 | return ret; |
806 | } | 803 | } |
807 | 804 | ||
808 | static int mxsfb_init_fbinfo(struct mxsfb_info *host, | 805 | static int mxsfb_init_fbinfo(struct fb_info *fb_info, |
809 | struct fb_videomode *vmode) | 806 | struct fb_videomode *vmode) |
810 | { | 807 | { |
811 | int ret; | 808 | int ret; |
809 | struct mxsfb_info *host = fb_info->par; | ||
812 | struct device *dev = &host->pdev->dev; | 810 | struct device *dev = &host->pdev->dev; |
813 | struct fb_info *fb_info = &host->fb_info; | ||
814 | struct fb_var_screeninfo *var = &fb_info->var; | 811 | struct fb_var_screeninfo *var = &fb_info->var; |
815 | dma_addr_t fb_phys; | 812 | dma_addr_t fb_phys; |
816 | void *fb_virt; | 813 | void *fb_virt; |
@@ -824,7 +821,7 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host, | |||
824 | fb_info->fix.visual = FB_VISUAL_TRUECOLOR, | 821 | fb_info->fix.visual = FB_VISUAL_TRUECOLOR, |
825 | fb_info->fix.accel = FB_ACCEL_NONE; | 822 | fb_info->fix.accel = FB_ACCEL_NONE; |
826 | 823 | ||
827 | ret = mxsfb_init_fbinfo_dt(host, vmode); | 824 | ret = mxsfb_init_fbinfo_dt(fb_info, vmode); |
828 | if (ret) | 825 | if (ret) |
829 | return ret; | 826 | return ret; |
830 | 827 | ||
@@ -843,16 +840,16 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host, | |||
843 | fb_info->screen_base = fb_virt; | 840 | fb_info->screen_base = fb_virt; |
844 | fb_info->screen_size = fb_info->fix.smem_len = fb_size; | 841 | fb_info->screen_size = fb_info->fix.smem_len = fb_size; |
845 | 842 | ||
846 | if (mxsfb_restore_mode(host, vmode)) | 843 | if (mxsfb_restore_mode(fb_info, vmode)) |
847 | memset(fb_virt, 0, fb_size); | 844 | memset(fb_virt, 0, fb_size); |
848 | 845 | ||
849 | return 0; | 846 | return 0; |
850 | } | 847 | } |
851 | 848 | ||
852 | static void mxsfb_free_videomem(struct mxsfb_info *host) | 849 | static void mxsfb_free_videomem(struct fb_info *fb_info) |
853 | { | 850 | { |
851 | struct mxsfb_info *host = fb_info->par; | ||
854 | struct device *dev = &host->pdev->dev; | 852 | struct device *dev = &host->pdev->dev; |
855 | struct fb_info *fb_info = &host->fb_info; | ||
856 | 853 | ||
857 | dma_free_wc(dev, fb_info->screen_size, fb_info->screen_base, | 854 | dma_free_wc(dev, fb_info->screen_size, fb_info->screen_base, |
858 | fb_info->fix.smem_start); | 855 | fb_info->fix.smem_start); |
@@ -902,7 +899,7 @@ static int mxsfb_probe(struct platform_device *pdev) | |||
902 | if (mode == NULL) | 899 | if (mode == NULL) |
903 | return -ENOMEM; | 900 | return -ENOMEM; |
904 | 901 | ||
905 | host = to_imxfb_host(fb_info); | 902 | host = fb_info->par; |
906 | 903 | ||
907 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 904 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
908 | host->base = devm_ioremap_resource(&pdev->dev, res); | 905 | host->base = devm_ioremap_resource(&pdev->dev, res); |
@@ -941,7 +938,7 @@ static int mxsfb_probe(struct platform_device *pdev) | |||
941 | goto fb_release; | 938 | goto fb_release; |
942 | } | 939 | } |
943 | 940 | ||
944 | ret = mxsfb_init_fbinfo(host, mode); | 941 | ret = mxsfb_init_fbinfo(fb_info, mode); |
945 | if (ret != 0) | 942 | if (ret != 0) |
946 | goto fb_release; | 943 | goto fb_release; |
947 | 944 | ||
@@ -982,13 +979,13 @@ fb_release: | |||
982 | static int mxsfb_remove(struct platform_device *pdev) | 979 | static int mxsfb_remove(struct platform_device *pdev) |
983 | { | 980 | { |
984 | struct fb_info *fb_info = platform_get_drvdata(pdev); | 981 | struct fb_info *fb_info = platform_get_drvdata(pdev); |
985 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 982 | struct mxsfb_info *host = fb_info->par; |
986 | 983 | ||
987 | if (host->enabled) | 984 | if (host->enabled) |
988 | mxsfb_disable_controller(fb_info); | 985 | mxsfb_disable_controller(fb_info); |
989 | 986 | ||
990 | unregister_framebuffer(fb_info); | 987 | unregister_framebuffer(fb_info); |
991 | mxsfb_free_videomem(host); | 988 | mxsfb_free_videomem(fb_info); |
992 | 989 | ||
993 | framebuffer_release(fb_info); | 990 | framebuffer_release(fb_info); |
994 | 991 | ||
@@ -998,7 +995,7 @@ static int mxsfb_remove(struct platform_device *pdev) | |||
998 | static void mxsfb_shutdown(struct platform_device *pdev) | 995 | static void mxsfb_shutdown(struct platform_device *pdev) |
999 | { | 996 | { |
1000 | struct fb_info *fb_info = platform_get_drvdata(pdev); | 997 | struct fb_info *fb_info = platform_get_drvdata(pdev); |
1001 | struct mxsfb_info *host = to_imxfb_host(fb_info); | 998 | struct mxsfb_info *host = fb_info->par; |
1002 | 999 | ||
1003 | mxsfb_enable_axi_clk(host); | 1000 | mxsfb_enable_axi_clk(host); |
1004 | 1001 | ||
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index 7a75dfda9845..fb605aefd9b1 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c | |||
@@ -3976,52 +3976,33 @@ static const struct dispc_features omap54xx_dispc_feats = { | |||
3976 | .has_writeback = true, | 3976 | .has_writeback = true, |
3977 | }; | 3977 | }; |
3978 | 3978 | ||
3979 | static int dispc_init_features(struct platform_device *pdev) | 3979 | static const struct dispc_features *dispc_get_features(void) |
3980 | { | 3980 | { |
3981 | const struct dispc_features *src; | ||
3982 | struct dispc_features *dst; | ||
3983 | |||
3984 | dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); | ||
3985 | if (!dst) { | ||
3986 | dev_err(&pdev->dev, "Failed to allocate DISPC Features\n"); | ||
3987 | return -ENOMEM; | ||
3988 | } | ||
3989 | |||
3990 | switch (omapdss_get_version()) { | 3981 | switch (omapdss_get_version()) { |
3991 | case OMAPDSS_VER_OMAP24xx: | 3982 | case OMAPDSS_VER_OMAP24xx: |
3992 | src = &omap24xx_dispc_feats; | 3983 | return &omap24xx_dispc_feats; |
3993 | break; | ||
3994 | 3984 | ||
3995 | case OMAPDSS_VER_OMAP34xx_ES1: | 3985 | case OMAPDSS_VER_OMAP34xx_ES1: |
3996 | src = &omap34xx_rev1_0_dispc_feats; | 3986 | return &omap34xx_rev1_0_dispc_feats; |
3997 | break; | ||
3998 | 3987 | ||
3999 | case OMAPDSS_VER_OMAP34xx_ES3: | 3988 | case OMAPDSS_VER_OMAP34xx_ES3: |
4000 | case OMAPDSS_VER_OMAP3630: | 3989 | case OMAPDSS_VER_OMAP3630: |
4001 | case OMAPDSS_VER_AM35xx: | 3990 | case OMAPDSS_VER_AM35xx: |
4002 | case OMAPDSS_VER_AM43xx: | 3991 | case OMAPDSS_VER_AM43xx: |
4003 | src = &omap34xx_rev3_0_dispc_feats; | 3992 | return &omap34xx_rev3_0_dispc_feats; |
4004 | break; | ||
4005 | 3993 | ||
4006 | case OMAPDSS_VER_OMAP4430_ES1: | 3994 | case OMAPDSS_VER_OMAP4430_ES1: |
4007 | case OMAPDSS_VER_OMAP4430_ES2: | 3995 | case OMAPDSS_VER_OMAP4430_ES2: |
4008 | case OMAPDSS_VER_OMAP4: | 3996 | case OMAPDSS_VER_OMAP4: |
4009 | src = &omap44xx_dispc_feats; | 3997 | return &omap44xx_dispc_feats; |
4010 | break; | ||
4011 | 3998 | ||
4012 | case OMAPDSS_VER_OMAP5: | 3999 | case OMAPDSS_VER_OMAP5: |
4013 | case OMAPDSS_VER_DRA7xx: | 4000 | case OMAPDSS_VER_DRA7xx: |
4014 | src = &omap54xx_dispc_feats; | 4001 | return &omap54xx_dispc_feats; |
4015 | break; | ||
4016 | 4002 | ||
4017 | default: | 4003 | default: |
4018 | return -ENODEV; | 4004 | return NULL; |
4019 | } | 4005 | } |
4020 | |||
4021 | memcpy(dst, src, sizeof(*dst)); | ||
4022 | dispc.feat = dst; | ||
4023 | |||
4024 | return 0; | ||
4025 | } | 4006 | } |
4026 | 4007 | ||
4027 | static irqreturn_t dispc_irq_handler(int irq, void *arg) | 4008 | static irqreturn_t dispc_irq_handler(int irq, void *arg) |
@@ -4078,9 +4059,9 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) | |||
4078 | 4059 | ||
4079 | spin_lock_init(&dispc.control_lock); | 4060 | spin_lock_init(&dispc.control_lock); |
4080 | 4061 | ||
4081 | r = dispc_init_features(dispc.pdev); | 4062 | dispc.feat = dispc_get_features(); |
4082 | if (r) | 4063 | if (!dispc.feat) |
4083 | return r; | 4064 | return -ENODEV; |
4084 | 4065 | ||
4085 | dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0); | 4066 | dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0); |
4086 | if (!dispc_mem) { | 4067 | if (!dispc_mem) { |
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index 48c6500c24e1..39fe7247ff98 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c | |||
@@ -887,58 +887,37 @@ static const struct dss_features dra7xx_dss_feats = { | |||
887 | .num_ports = ARRAY_SIZE(dra7xx_ports), | 887 | .num_ports = ARRAY_SIZE(dra7xx_ports), |
888 | }; | 888 | }; |
889 | 889 | ||
890 | static int dss_init_features(struct platform_device *pdev) | 890 | static const struct dss_features *dss_get_features(void) |
891 | { | 891 | { |
892 | const struct dss_features *src; | ||
893 | struct dss_features *dst; | ||
894 | |||
895 | dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); | ||
896 | if (!dst) { | ||
897 | dev_err(&pdev->dev, "Failed to allocate local DSS Features\n"); | ||
898 | return -ENOMEM; | ||
899 | } | ||
900 | |||
901 | switch (omapdss_get_version()) { | 892 | switch (omapdss_get_version()) { |
902 | case OMAPDSS_VER_OMAP24xx: | 893 | case OMAPDSS_VER_OMAP24xx: |
903 | src = &omap24xx_dss_feats; | 894 | return &omap24xx_dss_feats; |
904 | break; | ||
905 | 895 | ||
906 | case OMAPDSS_VER_OMAP34xx_ES1: | 896 | case OMAPDSS_VER_OMAP34xx_ES1: |
907 | case OMAPDSS_VER_OMAP34xx_ES3: | 897 | case OMAPDSS_VER_OMAP34xx_ES3: |
908 | case OMAPDSS_VER_AM35xx: | 898 | case OMAPDSS_VER_AM35xx: |
909 | src = &omap34xx_dss_feats; | 899 | return &omap34xx_dss_feats; |
910 | break; | ||
911 | 900 | ||
912 | case OMAPDSS_VER_OMAP3630: | 901 | case OMAPDSS_VER_OMAP3630: |
913 | src = &omap3630_dss_feats; | 902 | return &omap3630_dss_feats; |
914 | break; | ||
915 | 903 | ||
916 | case OMAPDSS_VER_OMAP4430_ES1: | 904 | case OMAPDSS_VER_OMAP4430_ES1: |
917 | case OMAPDSS_VER_OMAP4430_ES2: | 905 | case OMAPDSS_VER_OMAP4430_ES2: |
918 | case OMAPDSS_VER_OMAP4: | 906 | case OMAPDSS_VER_OMAP4: |
919 | src = &omap44xx_dss_feats; | 907 | return &omap44xx_dss_feats; |
920 | break; | ||
921 | 908 | ||
922 | case OMAPDSS_VER_OMAP5: | 909 | case OMAPDSS_VER_OMAP5: |
923 | src = &omap54xx_dss_feats; | 910 | return &omap54xx_dss_feats; |
924 | break; | ||
925 | 911 | ||
926 | case OMAPDSS_VER_AM43xx: | 912 | case OMAPDSS_VER_AM43xx: |
927 | src = &am43xx_dss_feats; | 913 | return &am43xx_dss_feats; |
928 | break; | ||
929 | 914 | ||
930 | case OMAPDSS_VER_DRA7xx: | 915 | case OMAPDSS_VER_DRA7xx: |
931 | src = &dra7xx_dss_feats; | 916 | return &dra7xx_dss_feats; |
932 | break; | ||
933 | 917 | ||
934 | default: | 918 | default: |
935 | return -ENODEV; | 919 | return NULL; |
936 | } | 920 | } |
937 | |||
938 | memcpy(dst, src, sizeof(*dst)); | ||
939 | dss.feat = dst; | ||
940 | |||
941 | return 0; | ||
942 | } | 921 | } |
943 | 922 | ||
944 | static void dss_uninit_ports(struct platform_device *pdev); | 923 | static void dss_uninit_ports(struct platform_device *pdev); |
@@ -1104,9 +1083,9 @@ static int dss_bind(struct device *dev) | |||
1104 | 1083 | ||
1105 | dss.pdev = pdev; | 1084 | dss.pdev = pdev; |
1106 | 1085 | ||
1107 | r = dss_init_features(dss.pdev); | 1086 | dss.feat = dss_get_features(); |
1108 | if (r) | 1087 | if (!dss.feat) |
1109 | return r; | 1088 | return -ENODEV; |
1110 | 1089 | ||
1111 | dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0); | 1090 | dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0); |
1112 | if (!dss_mem) { | 1091 | if (!dss_mem) { |
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index ec78d61bc551..28de56e21c74 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | |||
@@ -673,10 +673,7 @@ static int hdmi_audio_register(struct device *dev) | |||
673 | dev, "omap-hdmi-audio", PLATFORM_DEVID_AUTO, | 673 | dev, "omap-hdmi-audio", PLATFORM_DEVID_AUTO, |
674 | &pdata, sizeof(pdata)); | 674 | &pdata, sizeof(pdata)); |
675 | 675 | ||
676 | if (IS_ERR(hdmi.audio_pdev)) | 676 | return PTR_ERR_OR_ZERO(hdmi.audio_pdev); |
677 | return PTR_ERR(hdmi.audio_pdev); | ||
678 | |||
679 | return 0; | ||
680 | } | 677 | } |
681 | 678 | ||
682 | /* HDMI HW IP initialisation */ | 679 | /* HDMI HW IP initialisation */ |
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c index 9a13c35fd6d8..eee09b4bdcf6 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c | |||
@@ -189,47 +189,30 @@ static const struct hdmi_phy_features omap54xx_phy_feats = { | |||
189 | .max_phy = 186000000, | 189 | .max_phy = 186000000, |
190 | }; | 190 | }; |
191 | 191 | ||
192 | static int hdmi_phy_init_features(struct platform_device *pdev) | 192 | static const struct hdmi_phy_features *hdmi_phy_get_features(void) |
193 | { | 193 | { |
194 | struct hdmi_phy_features *dst; | ||
195 | const struct hdmi_phy_features *src; | ||
196 | |||
197 | dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); | ||
198 | if (!dst) { | ||
199 | dev_err(&pdev->dev, "Failed to allocate HDMI PHY Features\n"); | ||
200 | return -ENOMEM; | ||
201 | } | ||
202 | |||
203 | switch (omapdss_get_version()) { | 194 | switch (omapdss_get_version()) { |
204 | case OMAPDSS_VER_OMAP4430_ES1: | 195 | case OMAPDSS_VER_OMAP4430_ES1: |
205 | case OMAPDSS_VER_OMAP4430_ES2: | 196 | case OMAPDSS_VER_OMAP4430_ES2: |
206 | case OMAPDSS_VER_OMAP4: | 197 | case OMAPDSS_VER_OMAP4: |
207 | src = &omap44xx_phy_feats; | 198 | return &omap44xx_phy_feats; |
208 | break; | ||
209 | 199 | ||
210 | case OMAPDSS_VER_OMAP5: | 200 | case OMAPDSS_VER_OMAP5: |
211 | case OMAPDSS_VER_DRA7xx: | 201 | case OMAPDSS_VER_DRA7xx: |
212 | src = &omap54xx_phy_feats; | 202 | return &omap54xx_phy_feats; |
213 | break; | ||
214 | 203 | ||
215 | default: | 204 | default: |
216 | return -ENODEV; | 205 | return NULL; |
217 | } | 206 | } |
218 | |||
219 | memcpy(dst, src, sizeof(*dst)); | ||
220 | phy_feat = dst; | ||
221 | |||
222 | return 0; | ||
223 | } | 207 | } |
224 | 208 | ||
225 | int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy) | 209 | int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy) |
226 | { | 210 | { |
227 | int r; | ||
228 | struct resource *res; | 211 | struct resource *res; |
229 | 212 | ||
230 | r = hdmi_phy_init_features(pdev); | 213 | phy_feat = hdmi_phy_get_features(); |
231 | if (r) | 214 | if (!phy_feat) |
232 | return r; | 215 | return -ENODEV; |
233 | 216 | ||
234 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); | 217 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); |
235 | if (!res) { | 218 | if (!res) { |
diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 55fbb432c053..0955622a1227 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c | |||
@@ -104,7 +104,7 @@ struct pxa3xx_gcu_priv { | |||
104 | wait_queue_head_t wait_idle; | 104 | wait_queue_head_t wait_idle; |
105 | wait_queue_head_t wait_free; | 105 | wait_queue_head_t wait_free; |
106 | spinlock_t spinlock; | 106 | spinlock_t spinlock; |
107 | struct timeval base_time; | 107 | struct timespec64 base_time; |
108 | 108 | ||
109 | struct pxa3xx_gcu_batch *free; | 109 | struct pxa3xx_gcu_batch *free; |
110 | struct pxa3xx_gcu_batch *ready; | 110 | struct pxa3xx_gcu_batch *ready; |
@@ -126,18 +126,20 @@ gc_writel(struct pxa3xx_gcu_priv *priv, unsigned int off, unsigned long val) | |||
126 | 126 | ||
127 | #define QPRINT(priv, level, msg) \ | 127 | #define QPRINT(priv, level, msg) \ |
128 | do { \ | 128 | do { \ |
129 | struct timeval tv; \ | 129 | struct timespec64 ts; \ |
130 | struct pxa3xx_gcu_shared *shared = priv->shared; \ | 130 | struct pxa3xx_gcu_shared *shared = priv->shared; \ |
131 | u32 base = gc_readl(priv, REG_GCRBBR); \ | 131 | u32 base = gc_readl(priv, REG_GCRBBR); \ |
132 | \ | 132 | \ |
133 | do_gettimeofday(&tv); \ | 133 | ktime_get_ts64(&ts); \ |
134 | ts = timespec64_sub(ts, priv->base_time); \ | ||
134 | \ | 135 | \ |
135 | printk(level "%ld.%03ld.%03ld - %-17s: %-21s (%s, " \ | 136 | printk(level "%lld.%03ld.%03ld - %-17s: %-21s (%s, " \ |
136 | "STATUS " \ | 137 | "STATUS " \ |
137 | "0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, " \ | 138 | "0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, " \ |
138 | "T %5ld)\n", \ | 139 | "T %5ld)\n", \ |
139 | tv.tv_sec - priv->base_time.tv_sec, \ | 140 | (s64)(ts.tv_sec), \ |
140 | tv.tv_usec / 1000, tv.tv_usec % 1000, \ | 141 | ts.tv_nsec / NSEC_PER_MSEC, \ |
142 | (ts.tv_nsec % NSEC_PER_MSEC) / USEC_PER_MSEC, \ | ||
141 | __func__, msg, \ | 143 | __func__, msg, \ |
142 | shared->hw_running ? "running" : " idle", \ | 144 | shared->hw_running ? "running" : " idle", \ |
143 | gc_readl(priv, REG_GCISCR), \ | 145 | gc_readl(priv, REG_GCISCR), \ |
@@ -164,7 +166,7 @@ pxa3xx_gcu_reset(struct pxa3xx_gcu_priv *priv) | |||
164 | priv->shared->buffer_phys = priv->shared_phys; | 166 | priv->shared->buffer_phys = priv->shared_phys; |
165 | priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC; | 167 | priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC; |
166 | 168 | ||
167 | do_gettimeofday(&priv->base_time); | 169 | ktime_get_ts64(&priv->base_time); |
168 | 170 | ||
169 | /* set up the ring buffer pointers */ | 171 | /* set up the ring buffer pointers */ |
170 | gc_writel(priv, REG_GCRBLR, 0); | 172 | gc_writel(priv, REG_GCRBLR, 0); |
diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index 2275e80b5776..8db7085e5d1a 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c | |||
@@ -1086,8 +1086,7 @@ static int ufx_ops_open(struct fb_info *info, int user) | |||
1086 | 1086 | ||
1087 | struct fb_deferred_io *fbdefio; | 1087 | struct fb_deferred_io *fbdefio; |
1088 | 1088 | ||
1089 | fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); | 1089 | fbdefio = kzalloc(sizeof(*fbdefio), GFP_KERNEL); |
1090 | |||
1091 | if (fbdefio) { | 1090 | if (fbdefio) { |
1092 | fbdefio->delay = UFX_DEFIO_WRITE_DELAY; | 1091 | fbdefio->delay = UFX_DEFIO_WRITE_DELAY; |
1093 | fbdefio->deferred_io = ufx_dpy_deferred_io; | 1092 | fbdefio->deferred_io = ufx_dpy_deferred_io; |
@@ -1875,7 +1874,7 @@ static int ufx_alloc_urb_list(struct ufx_data *dev, int count, size_t size) | |||
1875 | INIT_LIST_HEAD(&dev->urbs.list); | 1874 | INIT_LIST_HEAD(&dev->urbs.list); |
1876 | 1875 | ||
1877 | while (i < count) { | 1876 | while (i < count) { |
1878 | unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); | 1877 | unode = kzalloc(sizeof(*unode), GFP_KERNEL); |
1879 | if (!unode) | 1878 | if (!unode) |
1880 | break; | 1879 | break; |
1881 | unode->dev = dev; | 1880 | unode->dev = dev; |
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index d44f14242016..452a4207ac1b 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c | |||
@@ -16,8 +16,6 @@ | |||
16 | * from Florian Echtler, Henrik Bjerregaard Pedersen, and others. | 16 | * from Florian Echtler, Henrik Bjerregaard Pedersen, and others. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
21 | #include <linux/module.h> | 19 | #include <linux/module.h> |
22 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
23 | #include <linux/init.h> | 21 | #include <linux/init.h> |
@@ -32,7 +30,7 @@ | |||
32 | #include <video/udlfb.h> | 30 | #include <video/udlfb.h> |
33 | #include "edid.h" | 31 | #include "edid.h" |
34 | 32 | ||
35 | static struct fb_fix_screeninfo dlfb_fix = { | 33 | static const struct fb_fix_screeninfo dlfb_fix = { |
36 | .id = "udlfb", | 34 | .id = "udlfb", |
37 | .type = FB_TYPE_PACKED_PIXELS, | 35 | .type = FB_TYPE_PACKED_PIXELS, |
38 | .visual = FB_VISUAL_TRUECOLOR, | 36 | .visual = FB_VISUAL_TRUECOLOR, |
@@ -76,10 +74,10 @@ static int pixel_limit; /* Optionally force a pixel resolution limit */ | |||
76 | 74 | ||
77 | /* dlfb keeps a list of urbs for efficient bulk transfers */ | 75 | /* dlfb keeps a list of urbs for efficient bulk transfers */ |
78 | static void dlfb_urb_completion(struct urb *urb); | 76 | static void dlfb_urb_completion(struct urb *urb); |
79 | static struct urb *dlfb_get_urb(struct dlfb_data *dev); | 77 | static struct urb *dlfb_get_urb(struct dlfb_data *dlfb); |
80 | static int dlfb_submit_urb(struct dlfb_data *dev, struct urb * urb, size_t len); | 78 | static int dlfb_submit_urb(struct dlfb_data *dlfb, struct urb * urb, size_t len); |
81 | static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size); | 79 | static int dlfb_alloc_urb_list(struct dlfb_data *dlfb, int count, size_t size); |
82 | static void dlfb_free_urb_list(struct dlfb_data *dev); | 80 | static void dlfb_free_urb_list(struct dlfb_data *dlfb); |
83 | 81 | ||
84 | /* | 82 | /* |
85 | * All DisplayLink bulk operations start with 0xAF, followed by specific code | 83 | * All DisplayLink bulk operations start with 0xAF, followed by specific code |
@@ -274,7 +272,7 @@ static char *dlfb_set_vid_cmds(char *wrptr, struct fb_var_screeninfo *var) | |||
274 | * and then generates the appropriate command sequence that then drives the | 272 | * and then generates the appropriate command sequence that then drives the |
275 | * display controller. | 273 | * display controller. |
276 | */ | 274 | */ |
277 | static int dlfb_set_video_mode(struct dlfb_data *dev, | 275 | static int dlfb_set_video_mode(struct dlfb_data *dlfb, |
278 | struct fb_var_screeninfo *var) | 276 | struct fb_var_screeninfo *var) |
279 | { | 277 | { |
280 | char *buf; | 278 | char *buf; |
@@ -283,10 +281,10 @@ static int dlfb_set_video_mode(struct dlfb_data *dev, | |||
283 | int writesize; | 281 | int writesize; |
284 | struct urb *urb; | 282 | struct urb *urb; |
285 | 283 | ||
286 | if (!atomic_read(&dev->usb_active)) | 284 | if (!atomic_read(&dlfb->usb_active)) |
287 | return -EPERM; | 285 | return -EPERM; |
288 | 286 | ||
289 | urb = dlfb_get_urb(dev); | 287 | urb = dlfb_get_urb(dlfb); |
290 | if (!urb) | 288 | if (!urb) |
291 | return -ENOMEM; | 289 | return -ENOMEM; |
292 | 290 | ||
@@ -302,7 +300,7 @@ static int dlfb_set_video_mode(struct dlfb_data *dev, | |||
302 | /* set base for 16bpp segment to 0 */ | 300 | /* set base for 16bpp segment to 0 */ |
303 | wrptr = dlfb_set_base16bpp(wrptr, 0); | 301 | wrptr = dlfb_set_base16bpp(wrptr, 0); |
304 | /* set base for 8bpp segment to end of fb */ | 302 | /* set base for 8bpp segment to end of fb */ |
305 | wrptr = dlfb_set_base8bpp(wrptr, dev->info->fix.smem_len); | 303 | wrptr = dlfb_set_base8bpp(wrptr, dlfb->info->fix.smem_len); |
306 | 304 | ||
307 | wrptr = dlfb_set_vid_cmds(wrptr, var); | 305 | wrptr = dlfb_set_vid_cmds(wrptr, var); |
308 | wrptr = dlfb_blanking(wrptr, FB_BLANK_UNBLANK); | 306 | wrptr = dlfb_blanking(wrptr, FB_BLANK_UNBLANK); |
@@ -310,9 +308,9 @@ static int dlfb_set_video_mode(struct dlfb_data *dev, | |||
310 | 308 | ||
311 | writesize = wrptr - buf; | 309 | writesize = wrptr - buf; |
312 | 310 | ||
313 | retval = dlfb_submit_urb(dev, urb, writesize); | 311 | retval = dlfb_submit_urb(dlfb, urb, writesize); |
314 | 312 | ||
315 | dev->blank_mode = FB_BLANK_UNBLANK; | 313 | dlfb->blank_mode = FB_BLANK_UNBLANK; |
316 | 314 | ||
317 | return retval; | 315 | return retval; |
318 | } | 316 | } |
@@ -333,8 +331,8 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
333 | 331 | ||
334 | pos = (unsigned long)info->fix.smem_start + offset; | 332 | pos = (unsigned long)info->fix.smem_start + offset; |
335 | 333 | ||
336 | pr_notice("mmap() framebuffer addr:%lu size:%lu\n", | 334 | dev_dbg(info->dev, "mmap() framebuffer addr:%lu size:%lu\n", |
337 | pos, size); | 335 | pos, size); |
338 | 336 | ||
339 | while (size > 0) { | 337 | while (size > 0) { |
340 | page = vmalloc_to_pfn((void *)pos); | 338 | page = vmalloc_to_pfn((void *)pos); |
@@ -505,8 +503,6 @@ static void dlfb_compress_hline( | |||
505 | *command_buffer_ptr = cmd; | 503 | *command_buffer_ptr = cmd; |
506 | *pixel_start_ptr = pixel; | 504 | *pixel_start_ptr = pixel; |
507 | *device_address_ptr = dev_addr; | 505 | *device_address_ptr = dev_addr; |
508 | |||
509 | return; | ||
510 | } | 506 | } |
511 | 507 | ||
512 | /* | 508 | /* |
@@ -515,13 +511,13 @@ static void dlfb_compress_hline( | |||
515 | * (that we can only write to, slowly, and can never read), and (optionally) | 511 | * (that we can only write to, slowly, and can never read), and (optionally) |
516 | * our shadow copy that tracks what's been sent to that hardware buffer. | 512 | * our shadow copy that tracks what's been sent to that hardware buffer. |
517 | */ | 513 | */ |
518 | static int dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr, | 514 | static int dlfb_render_hline(struct dlfb_data *dlfb, struct urb **urb_ptr, |
519 | const char *front, char **urb_buf_ptr, | 515 | const char *front, char **urb_buf_ptr, |
520 | u32 byte_offset, u32 byte_width, | 516 | u32 byte_offset, u32 byte_width, |
521 | int *ident_ptr, int *sent_ptr) | 517 | int *ident_ptr, int *sent_ptr) |
522 | { | 518 | { |
523 | const u8 *line_start, *line_end, *next_pixel; | 519 | const u8 *line_start, *line_end, *next_pixel; |
524 | u32 dev_addr = dev->base16 + byte_offset; | 520 | u32 dev_addr = dlfb->base16 + byte_offset; |
525 | struct urb *urb = *urb_ptr; | 521 | struct urb *urb = *urb_ptr; |
526 | u8 *cmd = *urb_buf_ptr; | 522 | u8 *cmd = *urb_buf_ptr; |
527 | u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length; | 523 | u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length; |
@@ -530,9 +526,9 @@ static int dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr, | |||
530 | next_pixel = line_start; | 526 | next_pixel = line_start; |
531 | line_end = next_pixel + byte_width; | 527 | line_end = next_pixel + byte_width; |
532 | 528 | ||
533 | if (dev->backing_buffer) { | 529 | if (dlfb->backing_buffer) { |
534 | int offset; | 530 | int offset; |
535 | const u8 *back_start = (u8 *) (dev->backing_buffer | 531 | const u8 *back_start = (u8 *) (dlfb->backing_buffer |
536 | + byte_offset); | 532 | + byte_offset); |
537 | 533 | ||
538 | *ident_ptr += dlfb_trim_hline(back_start, &next_pixel, | 534 | *ident_ptr += dlfb_trim_hline(back_start, &next_pixel, |
@@ -556,10 +552,10 @@ static int dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr, | |||
556 | 552 | ||
557 | if (cmd >= cmd_end) { | 553 | if (cmd >= cmd_end) { |
558 | int len = cmd - (u8 *) urb->transfer_buffer; | 554 | int len = cmd - (u8 *) urb->transfer_buffer; |
559 | if (dlfb_submit_urb(dev, urb, len)) | 555 | if (dlfb_submit_urb(dlfb, urb, len)) |
560 | return 1; /* lost pixels is set */ | 556 | return 1; /* lost pixels is set */ |
561 | *sent_ptr += len; | 557 | *sent_ptr += len; |
562 | urb = dlfb_get_urb(dev); | 558 | urb = dlfb_get_urb(dlfb); |
563 | if (!urb) | 559 | if (!urb) |
564 | return 1; /* lost_pixels is set */ | 560 | return 1; /* lost_pixels is set */ |
565 | *urb_ptr = urb; | 561 | *urb_ptr = urb; |
@@ -573,7 +569,7 @@ static int dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr, | |||
573 | return 0; | 569 | return 0; |
574 | } | 570 | } |
575 | 571 | ||
576 | static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, | 572 | static int dlfb_handle_damage(struct dlfb_data *dlfb, int x, int y, |
577 | int width, int height, char *data) | 573 | int width, int height, char *data) |
578 | { | 574 | { |
579 | int i, ret; | 575 | int i, ret; |
@@ -591,24 +587,24 @@ static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, | |||
591 | x = aligned_x; | 587 | x = aligned_x; |
592 | 588 | ||
593 | if ((width <= 0) || | 589 | if ((width <= 0) || |
594 | (x + width > dev->info->var.xres) || | 590 | (x + width > dlfb->info->var.xres) || |
595 | (y + height > dev->info->var.yres)) | 591 | (y + height > dlfb->info->var.yres)) |
596 | return -EINVAL; | 592 | return -EINVAL; |
597 | 593 | ||
598 | if (!atomic_read(&dev->usb_active)) | 594 | if (!atomic_read(&dlfb->usb_active)) |
599 | return 0; | 595 | return 0; |
600 | 596 | ||
601 | urb = dlfb_get_urb(dev); | 597 | urb = dlfb_get_urb(dlfb); |
602 | if (!urb) | 598 | if (!urb) |
603 | return 0; | 599 | return 0; |
604 | cmd = urb->transfer_buffer; | 600 | cmd = urb->transfer_buffer; |
605 | 601 | ||
606 | for (i = y; i < y + height ; i++) { | 602 | for (i = y; i < y + height ; i++) { |
607 | const int line_offset = dev->info->fix.line_length * i; | 603 | const int line_offset = dlfb->info->fix.line_length * i; |
608 | const int byte_offset = line_offset + (x * BPP); | 604 | const int byte_offset = line_offset + (x * BPP); |
609 | 605 | ||
610 | if (dlfb_render_hline(dev, &urb, | 606 | if (dlfb_render_hline(dlfb, &urb, |
611 | (char *) dev->info->fix.smem_start, | 607 | (char *) dlfb->info->fix.smem_start, |
612 | &cmd, byte_offset, width * BPP, | 608 | &cmd, byte_offset, width * BPP, |
613 | &bytes_identical, &bytes_sent)) | 609 | &bytes_identical, &bytes_sent)) |
614 | goto error; | 610 | goto error; |
@@ -617,19 +613,19 @@ static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, | |||
617 | if (cmd > (char *) urb->transfer_buffer) { | 613 | if (cmd > (char *) urb->transfer_buffer) { |
618 | /* Send partial buffer remaining before exiting */ | 614 | /* Send partial buffer remaining before exiting */ |
619 | int len = cmd - (char *) urb->transfer_buffer; | 615 | int len = cmd - (char *) urb->transfer_buffer; |
620 | ret = dlfb_submit_urb(dev, urb, len); | 616 | ret = dlfb_submit_urb(dlfb, urb, len); |
621 | bytes_sent += len; | 617 | bytes_sent += len; |
622 | } else | 618 | } else |
623 | dlfb_urb_completion(urb); | 619 | dlfb_urb_completion(urb); |
624 | 620 | ||
625 | error: | 621 | error: |
626 | atomic_add(bytes_sent, &dev->bytes_sent); | 622 | atomic_add(bytes_sent, &dlfb->bytes_sent); |
627 | atomic_add(bytes_identical, &dev->bytes_identical); | 623 | atomic_add(bytes_identical, &dlfb->bytes_identical); |
628 | atomic_add(width*height*2, &dev->bytes_rendered); | 624 | atomic_add(width*height*2, &dlfb->bytes_rendered); |
629 | end_cycles = get_cycles(); | 625 | end_cycles = get_cycles(); |
630 | atomic_add(((unsigned int) ((end_cycles - start_cycles) | 626 | atomic_add(((unsigned int) ((end_cycles - start_cycles) |
631 | >> 10)), /* Kcycles */ | 627 | >> 10)), /* Kcycles */ |
632 | &dev->cpu_kcycles_used); | 628 | &dlfb->cpu_kcycles_used); |
633 | 629 | ||
634 | return 0; | 630 | return 0; |
635 | } | 631 | } |
@@ -644,7 +640,7 @@ static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf, | |||
644 | size_t count, loff_t *ppos) | 640 | size_t count, loff_t *ppos) |
645 | { | 641 | { |
646 | ssize_t result; | 642 | ssize_t result; |
647 | struct dlfb_data *dev = info->par; | 643 | struct dlfb_data *dlfb = info->par; |
648 | u32 offset = (u32) *ppos; | 644 | u32 offset = (u32) *ppos; |
649 | 645 | ||
650 | result = fb_sys_write(info, buf, count, ppos); | 646 | result = fb_sys_write(info, buf, count, ppos); |
@@ -654,7 +650,7 @@ static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf, | |||
654 | int lines = min((u32)((result / info->fix.line_length) + 1), | 650 | int lines = min((u32)((result / info->fix.line_length) + 1), |
655 | (u32)info->var.yres); | 651 | (u32)info->var.yres); |
656 | 652 | ||
657 | dlfb_handle_damage(dev, 0, start, info->var.xres, | 653 | dlfb_handle_damage(dlfb, 0, start, info->var.xres, |
658 | lines, info->screen_base); | 654 | lines, info->screen_base); |
659 | } | 655 | } |
660 | 656 | ||
@@ -666,33 +662,33 @@ static void dlfb_ops_copyarea(struct fb_info *info, | |||
666 | const struct fb_copyarea *area) | 662 | const struct fb_copyarea *area) |
667 | { | 663 | { |
668 | 664 | ||
669 | struct dlfb_data *dev = info->par; | 665 | struct dlfb_data *dlfb = info->par; |
670 | 666 | ||
671 | sys_copyarea(info, area); | 667 | sys_copyarea(info, area); |
672 | 668 | ||
673 | dlfb_handle_damage(dev, area->dx, area->dy, | 669 | dlfb_handle_damage(dlfb, area->dx, area->dy, |
674 | area->width, area->height, info->screen_base); | 670 | area->width, area->height, info->screen_base); |
675 | } | 671 | } |
676 | 672 | ||
677 | static void dlfb_ops_imageblit(struct fb_info *info, | 673 | static void dlfb_ops_imageblit(struct fb_info *info, |
678 | const struct fb_image *image) | 674 | const struct fb_image *image) |
679 | { | 675 | { |
680 | struct dlfb_data *dev = info->par; | 676 | struct dlfb_data *dlfb = info->par; |
681 | 677 | ||
682 | sys_imageblit(info, image); | 678 | sys_imageblit(info, image); |
683 | 679 | ||
684 | dlfb_handle_damage(dev, image->dx, image->dy, | 680 | dlfb_handle_damage(dlfb, image->dx, image->dy, |
685 | image->width, image->height, info->screen_base); | 681 | image->width, image->height, info->screen_base); |
686 | } | 682 | } |
687 | 683 | ||
688 | static void dlfb_ops_fillrect(struct fb_info *info, | 684 | static void dlfb_ops_fillrect(struct fb_info *info, |
689 | const struct fb_fillrect *rect) | 685 | const struct fb_fillrect *rect) |
690 | { | 686 | { |
691 | struct dlfb_data *dev = info->par; | 687 | struct dlfb_data *dlfb = info->par; |
692 | 688 | ||
693 | sys_fillrect(info, rect); | 689 | sys_fillrect(info, rect); |
694 | 690 | ||
695 | dlfb_handle_damage(dev, rect->dx, rect->dy, rect->width, | 691 | dlfb_handle_damage(dlfb, rect->dx, rect->dy, rect->width, |
696 | rect->height, info->screen_base); | 692 | rect->height, info->screen_base); |
697 | } | 693 | } |
698 | 694 | ||
@@ -707,7 +703,7 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, | |||
707 | { | 703 | { |
708 | struct page *cur; | 704 | struct page *cur; |
709 | struct fb_deferred_io *fbdefio = info->fbdefio; | 705 | struct fb_deferred_io *fbdefio = info->fbdefio; |
710 | struct dlfb_data *dev = info->par; | 706 | struct dlfb_data *dlfb = info->par; |
711 | struct urb *urb; | 707 | struct urb *urb; |
712 | char *cmd; | 708 | char *cmd; |
713 | cycles_t start_cycles, end_cycles; | 709 | cycles_t start_cycles, end_cycles; |
@@ -718,12 +714,12 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, | |||
718 | if (!fb_defio) | 714 | if (!fb_defio) |
719 | return; | 715 | return; |
720 | 716 | ||
721 | if (!atomic_read(&dev->usb_active)) | 717 | if (!atomic_read(&dlfb->usb_active)) |
722 | return; | 718 | return; |
723 | 719 | ||
724 | start_cycles = get_cycles(); | 720 | start_cycles = get_cycles(); |
725 | 721 | ||
726 | urb = dlfb_get_urb(dev); | 722 | urb = dlfb_get_urb(dlfb); |
727 | if (!urb) | 723 | if (!urb) |
728 | return; | 724 | return; |
729 | 725 | ||
@@ -732,7 +728,7 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, | |||
732 | /* walk the written page list and render each to device */ | 728 | /* walk the written page list and render each to device */ |
733 | list_for_each_entry(cur, &fbdefio->pagelist, lru) { | 729 | list_for_each_entry(cur, &fbdefio->pagelist, lru) { |
734 | 730 | ||
735 | if (dlfb_render_hline(dev, &urb, (char *) info->fix.smem_start, | 731 | if (dlfb_render_hline(dlfb, &urb, (char *) info->fix.smem_start, |
736 | &cmd, cur->index << PAGE_SHIFT, | 732 | &cmd, cur->index << PAGE_SHIFT, |
737 | PAGE_SIZE, &bytes_identical, &bytes_sent)) | 733 | PAGE_SIZE, &bytes_identical, &bytes_sent)) |
738 | goto error; | 734 | goto error; |
@@ -742,25 +738,24 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, | |||
742 | if (cmd > (char *) urb->transfer_buffer) { | 738 | if (cmd > (char *) urb->transfer_buffer) { |
743 | /* Send partial buffer remaining before exiting */ | 739 | /* Send partial buffer remaining before exiting */ |
744 | int len = cmd - (char *) urb->transfer_buffer; | 740 | int len = cmd - (char *) urb->transfer_buffer; |
745 | dlfb_submit_urb(dev, urb, len); | 741 | dlfb_submit_urb(dlfb, urb, len); |
746 | bytes_sent += len; | 742 | bytes_sent += len; |
747 | } else | 743 | } else |
748 | dlfb_urb_completion(urb); | 744 | dlfb_urb_completion(urb); |
749 | 745 | ||
750 | error: | 746 | error: |
751 | atomic_add(bytes_sent, &dev->bytes_sent); | 747 | atomic_add(bytes_sent, &dlfb->bytes_sent); |
752 | atomic_add(bytes_identical, &dev->bytes_identical); | 748 | atomic_add(bytes_identical, &dlfb->bytes_identical); |
753 | atomic_add(bytes_rendered, &dev->bytes_rendered); | 749 | atomic_add(bytes_rendered, &dlfb->bytes_rendered); |
754 | end_cycles = get_cycles(); | 750 | end_cycles = get_cycles(); |
755 | atomic_add(((unsigned int) ((end_cycles - start_cycles) | 751 | atomic_add(((unsigned int) ((end_cycles - start_cycles) |
756 | >> 10)), /* Kcycles */ | 752 | >> 10)), /* Kcycles */ |
757 | &dev->cpu_kcycles_used); | 753 | &dlfb->cpu_kcycles_used); |
758 | } | 754 | } |
759 | 755 | ||
760 | static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len) | 756 | static int dlfb_get_edid(struct dlfb_data *dlfb, char *edid, int len) |
761 | { | 757 | { |
762 | int i; | 758 | int i, ret; |
763 | int ret; | ||
764 | char *rbuf; | 759 | char *rbuf; |
765 | 760 | ||
766 | rbuf = kmalloc(2, GFP_KERNEL); | 761 | rbuf = kmalloc(2, GFP_KERNEL); |
@@ -768,12 +763,13 @@ static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len) | |||
768 | return 0; | 763 | return 0; |
769 | 764 | ||
770 | for (i = 0; i < len; i++) { | 765 | for (i = 0; i < len; i++) { |
771 | ret = usb_control_msg(dev->udev, | 766 | ret = usb_control_msg(dlfb->udev, |
772 | usb_rcvctrlpipe(dev->udev, 0), 0x02, | 767 | usb_rcvctrlpipe(dlfb->udev, 0), 0x02, |
773 | (0x80 | (0x02 << 5)), i << 8, 0xA1, | 768 | (0x80 | (0x02 << 5)), i << 8, 0xA1, |
774 | rbuf, 2, USB_CTRL_GET_TIMEOUT); | 769 | rbuf, 2, USB_CTRL_GET_TIMEOUT); |
775 | if (ret < 2) { | 770 | if (ret < 2) { |
776 | pr_err("Read EDID byte %d failed: %d\n", i, ret); | 771 | dev_err(&dlfb->udev->dev, |
772 | "Read EDID byte %d failed: %d\n", i, ret); | ||
777 | i--; | 773 | i--; |
778 | break; | 774 | break; |
779 | } | 775 | } |
@@ -789,15 +785,15 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd, | |||
789 | unsigned long arg) | 785 | unsigned long arg) |
790 | { | 786 | { |
791 | 787 | ||
792 | struct dlfb_data *dev = info->par; | 788 | struct dlfb_data *dlfb = info->par; |
793 | 789 | ||
794 | if (!atomic_read(&dev->usb_active)) | 790 | if (!atomic_read(&dlfb->usb_active)) |
795 | return 0; | 791 | return 0; |
796 | 792 | ||
797 | /* TODO: Update X server to get this from sysfs instead */ | 793 | /* TODO: Update X server to get this from sysfs instead */ |
798 | if (cmd == DLFB_IOCTL_RETURN_EDID) { | 794 | if (cmd == DLFB_IOCTL_RETURN_EDID) { |
799 | void __user *edid = (void __user *)arg; | 795 | void __user *edid = (void __user *)arg; |
800 | if (copy_to_user(edid, dev->edid, dev->edid_size)) | 796 | if (copy_to_user(edid, dlfb->edid, dlfb->edid_size)) |
801 | return -EFAULT; | 797 | return -EFAULT; |
802 | return 0; | 798 | return 0; |
803 | } | 799 | } |
@@ -832,7 +828,7 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd, | |||
832 | if (area.y > info->var.yres) | 828 | if (area.y > info->var.yres) |
833 | area.y = info->var.yres; | 829 | area.y = info->var.yres; |
834 | 830 | ||
835 | dlfb_handle_damage(dev, area.x, area.y, area.w, area.h, | 831 | dlfb_handle_damage(dlfb, area.x, area.y, area.w, area.h, |
836 | info->screen_base); | 832 | info->screen_base); |
837 | } | 833 | } |
838 | 834 | ||
@@ -873,7 +869,7 @@ dlfb_ops_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
873 | */ | 869 | */ |
874 | static int dlfb_ops_open(struct fb_info *info, int user) | 870 | static int dlfb_ops_open(struct fb_info *info, int user) |
875 | { | 871 | { |
876 | struct dlfb_data *dev = info->par; | 872 | struct dlfb_data *dlfb = info->par; |
877 | 873 | ||
878 | /* | 874 | /* |
879 | * fbcon aggressively connects to first framebuffer it finds, | 875 | * fbcon aggressively connects to first framebuffer it finds, |
@@ -884,12 +880,12 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
884 | return -EBUSY; | 880 | return -EBUSY; |
885 | 881 | ||
886 | /* If the USB device is gone, we don't accept new opens */ | 882 | /* If the USB device is gone, we don't accept new opens */ |
887 | if (dev->virtualized) | 883 | if (dlfb->virtualized) |
888 | return -ENODEV; | 884 | return -ENODEV; |
889 | 885 | ||
890 | dev->fb_count++; | 886 | dlfb->fb_count++; |
891 | 887 | ||
892 | kref_get(&dev->kref); | 888 | kref_get(&dlfb->kref); |
893 | 889 | ||
894 | if (fb_defio && (info->fbdefio == NULL)) { | 890 | if (fb_defio && (info->fbdefio == NULL)) { |
895 | /* enable defio at last moment if not disabled by client */ | 891 | /* enable defio at last moment if not disabled by client */ |
@@ -907,8 +903,8 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
907 | fb_deferred_io_init(info); | 903 | fb_deferred_io_init(info); |
908 | } | 904 | } |
909 | 905 | ||
910 | pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", | 906 | dev_dbg(info->dev, "open, user=%d fb_info=%p count=%d\n", |
911 | info->node, user, info, dev->fb_count); | 907 | user, info, dlfb->fb_count); |
912 | 908 | ||
913 | return 0; | 909 | return 0; |
914 | } | 910 | } |
@@ -920,15 +916,11 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
920 | */ | 916 | */ |
921 | static void dlfb_free(struct kref *kref) | 917 | static void dlfb_free(struct kref *kref) |
922 | { | 918 | { |
923 | struct dlfb_data *dev = container_of(kref, struct dlfb_data, kref); | 919 | struct dlfb_data *dlfb = container_of(kref, struct dlfb_data, kref); |
924 | 920 | ||
925 | vfree(dev->backing_buffer); | 921 | vfree(dlfb->backing_buffer); |
926 | 922 | kfree(dlfb->edid); | |
927 | kfree(dev->edid); | 923 | kfree(dlfb); |
928 | |||
929 | pr_warn("freeing dlfb_data %p\n", dev); | ||
930 | |||
931 | kfree(dev); | ||
932 | } | 924 | } |
933 | 925 | ||
934 | static void dlfb_release_urb_work(struct work_struct *work) | 926 | static void dlfb_release_urb_work(struct work_struct *work) |
@@ -936,16 +928,14 @@ static void dlfb_release_urb_work(struct work_struct *work) | |||
936 | struct urb_node *unode = container_of(work, struct urb_node, | 928 | struct urb_node *unode = container_of(work, struct urb_node, |
937 | release_urb_work.work); | 929 | release_urb_work.work); |
938 | 930 | ||
939 | up(&unode->dev->urbs.limit_sem); | 931 | up(&unode->dlfb->urbs.limit_sem); |
940 | } | 932 | } |
941 | 933 | ||
942 | static void dlfb_free_framebuffer(struct dlfb_data *dev) | 934 | static void dlfb_free_framebuffer(struct dlfb_data *dlfb) |
943 | { | 935 | { |
944 | struct fb_info *info = dev->info; | 936 | struct fb_info *info = dlfb->info; |
945 | 937 | ||
946 | if (info) { | 938 | if (info) { |
947 | int node = info->node; | ||
948 | |||
949 | unregister_framebuffer(info); | 939 | unregister_framebuffer(info); |
950 | 940 | ||
951 | if (info->cmap.len != 0) | 941 | if (info->cmap.len != 0) |
@@ -956,48 +946,45 @@ static void dlfb_free_framebuffer(struct dlfb_data *dev) | |||
956 | 946 | ||
957 | fb_destroy_modelist(&info->modelist); | 947 | fb_destroy_modelist(&info->modelist); |
958 | 948 | ||
959 | dev->info = NULL; | 949 | dlfb->info = NULL; |
960 | 950 | ||
961 | /* Assume info structure is freed after this point */ | 951 | /* Assume info structure is freed after this point */ |
962 | framebuffer_release(info); | 952 | framebuffer_release(info); |
963 | |||
964 | pr_warn("fb_info for /dev/fb%d has been freed\n", node); | ||
965 | } | 953 | } |
966 | 954 | ||
967 | /* ref taken in probe() as part of registering framebfufer */ | 955 | /* ref taken in probe() as part of registering framebfufer */ |
968 | kref_put(&dev->kref, dlfb_free); | 956 | kref_put(&dlfb->kref, dlfb_free); |
969 | } | 957 | } |
970 | 958 | ||
971 | static void dlfb_free_framebuffer_work(struct work_struct *work) | 959 | static void dlfb_free_framebuffer_work(struct work_struct *work) |
972 | { | 960 | { |
973 | struct dlfb_data *dev = container_of(work, struct dlfb_data, | 961 | struct dlfb_data *dlfb = container_of(work, struct dlfb_data, |
974 | free_framebuffer_work.work); | 962 | free_framebuffer_work.work); |
975 | dlfb_free_framebuffer(dev); | 963 | dlfb_free_framebuffer(dlfb); |
976 | } | 964 | } |
977 | /* | 965 | /* |
978 | * Assumes caller is holding info->lock mutex (for open and release at least) | 966 | * Assumes caller is holding info->lock mutex (for open and release at least) |
979 | */ | 967 | */ |
980 | static int dlfb_ops_release(struct fb_info *info, int user) | 968 | static int dlfb_ops_release(struct fb_info *info, int user) |
981 | { | 969 | { |
982 | struct dlfb_data *dev = info->par; | 970 | struct dlfb_data *dlfb = info->par; |
983 | 971 | ||
984 | dev->fb_count--; | 972 | dlfb->fb_count--; |
985 | 973 | ||
986 | /* We can't free fb_info here - fbmem will touch it when we return */ | 974 | /* We can't free fb_info here - fbmem will touch it when we return */ |
987 | if (dev->virtualized && (dev->fb_count == 0)) | 975 | if (dlfb->virtualized && (dlfb->fb_count == 0)) |
988 | schedule_delayed_work(&dev->free_framebuffer_work, HZ); | 976 | schedule_delayed_work(&dlfb->free_framebuffer_work, HZ); |
989 | 977 | ||
990 | if ((dev->fb_count == 0) && (info->fbdefio)) { | 978 | if ((dlfb->fb_count == 0) && (info->fbdefio)) { |
991 | fb_deferred_io_cleanup(info); | 979 | fb_deferred_io_cleanup(info); |
992 | kfree(info->fbdefio); | 980 | kfree(info->fbdefio); |
993 | info->fbdefio = NULL; | 981 | info->fbdefio = NULL; |
994 | info->fbops->fb_mmap = dlfb_ops_mmap; | 982 | info->fbops->fb_mmap = dlfb_ops_mmap; |
995 | } | 983 | } |
996 | 984 | ||
997 | pr_warn("released /dev/fb%d user=%d count=%d\n", | 985 | dev_dbg(info->dev, "release, user=%d count=%d\n", user, dlfb->fb_count); |
998 | info->node, user, dev->fb_count); | ||
999 | 986 | ||
1000 | kref_put(&dev->kref, dlfb_free); | 987 | kref_put(&dlfb->kref, dlfb_free); |
1001 | 988 | ||
1002 | return 0; | 989 | return 0; |
1003 | } | 990 | } |
@@ -1006,19 +993,10 @@ static int dlfb_ops_release(struct fb_info *info, int user) | |||
1006 | * Check whether a video mode is supported by the DisplayLink chip | 993 | * Check whether a video mode is supported by the DisplayLink chip |
1007 | * We start from monitor's modes, so don't need to filter that here | 994 | * We start from monitor's modes, so don't need to filter that here |
1008 | */ | 995 | */ |
1009 | static int dlfb_is_valid_mode(struct fb_videomode *mode, | 996 | static int dlfb_is_valid_mode(struct fb_videomode *mode, struct dlfb_data *dlfb) |
1010 | struct fb_info *info) | ||
1011 | { | 997 | { |
1012 | struct dlfb_data *dev = info->par; | 998 | if (mode->xres * mode->yres > dlfb->sku_pixel_limit) |
1013 | |||
1014 | if (mode->xres * mode->yres > dev->sku_pixel_limit) { | ||
1015 | pr_warn("%dx%d beyond chip capabilities\n", | ||
1016 | mode->xres, mode->yres); | ||
1017 | return 0; | 999 | return 0; |
1018 | } | ||
1019 | |||
1020 | pr_info("%dx%d @ %d Hz valid mode\n", mode->xres, mode->yres, | ||
1021 | mode->refresh); | ||
1022 | 1000 | ||
1023 | return 1; | 1001 | return 1; |
1024 | } | 1002 | } |
@@ -1039,6 +1017,7 @@ static int dlfb_ops_check_var(struct fb_var_screeninfo *var, | |||
1039 | struct fb_info *info) | 1017 | struct fb_info *info) |
1040 | { | 1018 | { |
1041 | struct fb_videomode mode; | 1019 | struct fb_videomode mode; |
1020 | struct dlfb_data *dlfb = info->par; | ||
1042 | 1021 | ||
1043 | /* TODO: support dynamically changing framebuffer size */ | 1022 | /* TODO: support dynamically changing framebuffer size */ |
1044 | if ((var->xres * var->yres * 2) > info->fix.smem_len) | 1023 | if ((var->xres * var->yres * 2) > info->fix.smem_len) |
@@ -1049,7 +1028,7 @@ static int dlfb_ops_check_var(struct fb_var_screeninfo *var, | |||
1049 | 1028 | ||
1050 | fb_var_to_videomode(&mode, var); | 1029 | fb_var_to_videomode(&mode, var); |
1051 | 1030 | ||
1052 | if (!dlfb_is_valid_mode(&mode, info)) | 1031 | if (!dlfb_is_valid_mode(&mode, dlfb)) |
1053 | return -EINVAL; | 1032 | return -EINVAL; |
1054 | 1033 | ||
1055 | return 0; | 1034 | return 0; |
@@ -1057,16 +1036,14 @@ static int dlfb_ops_check_var(struct fb_var_screeninfo *var, | |||
1057 | 1036 | ||
1058 | static int dlfb_ops_set_par(struct fb_info *info) | 1037 | static int dlfb_ops_set_par(struct fb_info *info) |
1059 | { | 1038 | { |
1060 | struct dlfb_data *dev = info->par; | 1039 | struct dlfb_data *dlfb = info->par; |
1061 | int result; | 1040 | int result; |
1062 | u16 *pix_framebuffer; | 1041 | u16 *pix_framebuffer; |
1063 | int i; | 1042 | int i; |
1064 | 1043 | ||
1065 | pr_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres); | 1044 | result = dlfb_set_video_mode(dlfb, &info->var); |
1066 | 1045 | ||
1067 | result = dlfb_set_video_mode(dev, &info->var); | 1046 | if ((result == 0) && (dlfb->fb_count == 0)) { |
1068 | |||
1069 | if ((result == 0) && (dev->fb_count == 0)) { | ||
1070 | 1047 | ||
1071 | /* paint greenscreen */ | 1048 | /* paint greenscreen */ |
1072 | 1049 | ||
@@ -1074,7 +1051,7 @@ static int dlfb_ops_set_par(struct fb_info *info) | |||
1074 | for (i = 0; i < info->fix.smem_len / 2; i++) | 1051 | for (i = 0; i < info->fix.smem_len / 2; i++) |
1075 | pix_framebuffer[i] = 0x37e6; | 1052 | pix_framebuffer[i] = 0x37e6; |
1076 | 1053 | ||
1077 | dlfb_handle_damage(dev, 0, 0, info->var.xres, info->var.yres, | 1054 | dlfb_handle_damage(dlfb, 0, 0, info->var.xres, info->var.yres, |
1078 | info->screen_base); | 1055 | info->screen_base); |
1079 | } | 1056 | } |
1080 | 1057 | ||
@@ -1101,21 +1078,21 @@ static char *dlfb_dummy_render(char *buf) | |||
1101 | */ | 1078 | */ |
1102 | static int dlfb_ops_blank(int blank_mode, struct fb_info *info) | 1079 | static int dlfb_ops_blank(int blank_mode, struct fb_info *info) |
1103 | { | 1080 | { |
1104 | struct dlfb_data *dev = info->par; | 1081 | struct dlfb_data *dlfb = info->par; |
1105 | char *bufptr; | 1082 | char *bufptr; |
1106 | struct urb *urb; | 1083 | struct urb *urb; |
1107 | 1084 | ||
1108 | pr_debug("/dev/fb%d FB_BLANK mode %d --> %d\n", | 1085 | dev_dbg(info->dev, "blank, mode %d --> %d\n", |
1109 | info->node, dev->blank_mode, blank_mode); | 1086 | dlfb->blank_mode, blank_mode); |
1110 | 1087 | ||
1111 | if ((dev->blank_mode == FB_BLANK_POWERDOWN) && | 1088 | if ((dlfb->blank_mode == FB_BLANK_POWERDOWN) && |
1112 | (blank_mode != FB_BLANK_POWERDOWN)) { | 1089 | (blank_mode != FB_BLANK_POWERDOWN)) { |
1113 | 1090 | ||
1114 | /* returning from powerdown requires a fresh modeset */ | 1091 | /* returning from powerdown requires a fresh modeset */ |
1115 | dlfb_set_video_mode(dev, &info->var); | 1092 | dlfb_set_video_mode(dlfb, &info->var); |
1116 | } | 1093 | } |
1117 | 1094 | ||
1118 | urb = dlfb_get_urb(dev); | 1095 | urb = dlfb_get_urb(dlfb); |
1119 | if (!urb) | 1096 | if (!urb) |
1120 | return 0; | 1097 | return 0; |
1121 | 1098 | ||
@@ -1127,10 +1104,10 @@ static int dlfb_ops_blank(int blank_mode, struct fb_info *info) | |||
1127 | /* seems like a render op is needed to have blank change take effect */ | 1104 | /* seems like a render op is needed to have blank change take effect */ |
1128 | bufptr = dlfb_dummy_render(bufptr); | 1105 | bufptr = dlfb_dummy_render(bufptr); |
1129 | 1106 | ||
1130 | dlfb_submit_urb(dev, urb, bufptr - | 1107 | dlfb_submit_urb(dlfb, urb, bufptr - |
1131 | (char *) urb->transfer_buffer); | 1108 | (char *) urb->transfer_buffer); |
1132 | 1109 | ||
1133 | dev->blank_mode = blank_mode; | 1110 | dlfb->blank_mode = blank_mode; |
1134 | 1111 | ||
1135 | return 0; | 1112 | return 0; |
1136 | } | 1113 | } |
@@ -1157,7 +1134,7 @@ static struct fb_ops dlfb_ops = { | |||
1157 | * Assumes &info->lock held by caller | 1134 | * Assumes &info->lock held by caller |
1158 | * Assumes no active clients have framebuffer open | 1135 | * Assumes no active clients have framebuffer open |
1159 | */ | 1136 | */ |
1160 | static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | 1137 | static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info) |
1161 | { | 1138 | { |
1162 | int retval = -ENOMEM; | 1139 | int retval = -ENOMEM; |
1163 | int old_len = info->fix.smem_len; | 1140 | int old_len = info->fix.smem_len; |
@@ -1166,8 +1143,6 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | |||
1166 | unsigned char *new_fb; | 1143 | unsigned char *new_fb; |
1167 | unsigned char *new_back = NULL; | 1144 | unsigned char *new_back = NULL; |
1168 | 1145 | ||
1169 | pr_warn("Reallocating framebuffer. Addresses will change!\n"); | ||
1170 | |||
1171 | new_len = info->fix.line_length * info->var.yres; | 1146 | new_len = info->fix.line_length * info->var.yres; |
1172 | 1147 | ||
1173 | if (PAGE_ALIGN(new_len) > old_len) { | 1148 | if (PAGE_ALIGN(new_len) > old_len) { |
@@ -1176,7 +1151,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | |||
1176 | */ | 1151 | */ |
1177 | new_fb = vmalloc(new_len); | 1152 | new_fb = vmalloc(new_len); |
1178 | if (!new_fb) { | 1153 | if (!new_fb) { |
1179 | pr_err("Virtual framebuffer alloc failed\n"); | 1154 | dev_err(info->dev, "Virtual framebuffer alloc failed\n"); |
1180 | goto error; | 1155 | goto error; |
1181 | } | 1156 | } |
1182 | 1157 | ||
@@ -1199,10 +1174,11 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | |||
1199 | if (shadow) | 1174 | if (shadow) |
1200 | new_back = vzalloc(new_len); | 1175 | new_back = vzalloc(new_len); |
1201 | if (!new_back) | 1176 | if (!new_back) |
1202 | pr_info("No shadow/backing buffer allocated\n"); | 1177 | dev_info(info->dev, |
1178 | "No shadow/backing buffer allocated\n"); | ||
1203 | else { | 1179 | else { |
1204 | vfree(dev->backing_buffer); | 1180 | vfree(dlfb->backing_buffer); |
1205 | dev->backing_buffer = new_back; | 1181 | dlfb->backing_buffer = new_back; |
1206 | } | 1182 | } |
1207 | } | 1183 | } |
1208 | 1184 | ||
@@ -1226,18 +1202,22 @@ error: | |||
1226 | * monspecs is NULL, and fb_var_screeninfo is set to safe VESA mode | 1202 | * monspecs is NULL, and fb_var_screeninfo is set to safe VESA mode |
1227 | * Returns 0 if successful | 1203 | * Returns 0 if successful |
1228 | */ | 1204 | */ |
1229 | static int dlfb_setup_modes(struct dlfb_data *dev, | 1205 | static int dlfb_setup_modes(struct dlfb_data *dlfb, |
1230 | struct fb_info *info, | 1206 | struct fb_info *info, |
1231 | char *default_edid, size_t default_edid_size) | 1207 | char *default_edid, size_t default_edid_size) |
1232 | { | 1208 | { |
1233 | int i; | ||
1234 | const struct fb_videomode *default_vmode = NULL; | ||
1235 | int result = 0; | ||
1236 | char *edid; | 1209 | char *edid; |
1237 | int tries = 3; | 1210 | int i, result = 0, tries = 3; |
1211 | struct device *dev = info->device; | ||
1212 | struct fb_videomode *mode; | ||
1213 | const struct fb_videomode *default_vmode = NULL; | ||
1238 | 1214 | ||
1239 | if (info->dev) /* only use mutex if info has been registered */ | 1215 | if (info->dev) { |
1216 | /* only use mutex if info has been registered */ | ||
1240 | mutex_lock(&info->lock); | 1217 | mutex_lock(&info->lock); |
1218 | /* parent device is used otherwise */ | ||
1219 | dev = info->dev; | ||
1220 | } | ||
1241 | 1221 | ||
1242 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 1222 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); |
1243 | if (!edid) { | 1223 | if (!edid) { |
@@ -1255,27 +1235,26 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1255 | */ | 1235 | */ |
1256 | while (tries--) { | 1236 | while (tries--) { |
1257 | 1237 | ||
1258 | i = dlfb_get_edid(dev, edid, EDID_LENGTH); | 1238 | i = dlfb_get_edid(dlfb, edid, EDID_LENGTH); |
1259 | 1239 | ||
1260 | if (i >= EDID_LENGTH) | 1240 | if (i >= EDID_LENGTH) |
1261 | fb_edid_to_monspecs(edid, &info->monspecs); | 1241 | fb_edid_to_monspecs(edid, &info->monspecs); |
1262 | 1242 | ||
1263 | if (info->monspecs.modedb_len > 0) { | 1243 | if (info->monspecs.modedb_len > 0) { |
1264 | dev->edid = edid; | 1244 | dlfb->edid = edid; |
1265 | dev->edid_size = i; | 1245 | dlfb->edid_size = i; |
1266 | break; | 1246 | break; |
1267 | } | 1247 | } |
1268 | } | 1248 | } |
1269 | 1249 | ||
1270 | /* If that fails, use a previously returned EDID if available */ | 1250 | /* If that fails, use a previously returned EDID if available */ |
1271 | if (info->monspecs.modedb_len == 0) { | 1251 | if (info->monspecs.modedb_len == 0) { |
1252 | dev_err(dev, "Unable to get valid EDID from device/display\n"); | ||
1272 | 1253 | ||
1273 | pr_err("Unable to get valid EDID from device/display\n"); | 1254 | if (dlfb->edid) { |
1274 | 1255 | fb_edid_to_monspecs(dlfb->edid, &info->monspecs); | |
1275 | if (dev->edid) { | ||
1276 | fb_edid_to_monspecs(dev->edid, &info->monspecs); | ||
1277 | if (info->monspecs.modedb_len > 0) | 1256 | if (info->monspecs.modedb_len > 0) |
1278 | pr_err("Using previously queried EDID\n"); | 1257 | dev_err(dev, "Using previously queried EDID\n"); |
1279 | } | 1258 | } |
1280 | } | 1259 | } |
1281 | 1260 | ||
@@ -1285,9 +1264,9 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1285 | fb_edid_to_monspecs(default_edid, &info->monspecs); | 1264 | fb_edid_to_monspecs(default_edid, &info->monspecs); |
1286 | if (info->monspecs.modedb_len > 0) { | 1265 | if (info->monspecs.modedb_len > 0) { |
1287 | memcpy(edid, default_edid, default_edid_size); | 1266 | memcpy(edid, default_edid, default_edid_size); |
1288 | dev->edid = edid; | 1267 | dlfb->edid = edid; |
1289 | dev->edid_size = default_edid_size; | 1268 | dlfb->edid_size = default_edid_size; |
1290 | pr_err("Using default/backup EDID\n"); | 1269 | dev_err(dev, "Using default/backup EDID\n"); |
1291 | } | 1270 | } |
1292 | } | 1271 | } |
1293 | } | 1272 | } |
@@ -1296,10 +1275,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1296 | if (info->monspecs.modedb_len > 0) { | 1275 | if (info->monspecs.modedb_len > 0) { |
1297 | 1276 | ||
1298 | for (i = 0; i < info->monspecs.modedb_len; i++) { | 1277 | for (i = 0; i < info->monspecs.modedb_len; i++) { |
1299 | if (dlfb_is_valid_mode(&info->monspecs.modedb[i], info)) | 1278 | mode = &info->monspecs.modedb[i]; |
1300 | fb_add_videomode(&info->monspecs.modedb[i], | 1279 | if (dlfb_is_valid_mode(mode, dlfb)) { |
1301 | &info->modelist); | 1280 | fb_add_videomode(mode, &info->modelist); |
1302 | else { | 1281 | } else { |
1282 | dev_dbg(dev, "Specified mode %dx%d too big\n", | ||
1283 | mode->xres, mode->yres); | ||
1303 | if (i == 0) | 1284 | if (i == 0) |
1304 | /* if we've removed top/best mode */ | 1285 | /* if we've removed top/best mode */ |
1305 | info->monspecs.misc | 1286 | info->monspecs.misc |
@@ -1323,10 +1304,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1323 | * But at least the user has a chance to choose | 1304 | * But at least the user has a chance to choose |
1324 | */ | 1305 | */ |
1325 | for (i = 0; i < VESA_MODEDB_SIZE; i++) { | 1306 | for (i = 0; i < VESA_MODEDB_SIZE; i++) { |
1326 | if (dlfb_is_valid_mode((struct fb_videomode *) | 1307 | mode = (struct fb_videomode *)&vesa_modes[i]; |
1327 | &vesa_modes[i], info)) | 1308 | if (dlfb_is_valid_mode(mode, dlfb)) |
1328 | fb_add_videomode(&vesa_modes[i], | 1309 | fb_add_videomode(mode, &info->modelist); |
1329 | &info->modelist); | 1310 | else |
1311 | dev_dbg(dev, "VESA mode %dx%d too big\n", | ||
1312 | mode->xres, mode->yres); | ||
1330 | } | 1313 | } |
1331 | 1314 | ||
1332 | /* | 1315 | /* |
@@ -1341,7 +1324,7 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1341 | } | 1324 | } |
1342 | 1325 | ||
1343 | /* If we have good mode and no active clients*/ | 1326 | /* If we have good mode and no active clients*/ |
1344 | if ((default_vmode != NULL) && (dev->fb_count == 0)) { | 1327 | if ((default_vmode != NULL) && (dlfb->fb_count == 0)) { |
1345 | 1328 | ||
1346 | fb_videomode_to_var(&info->var, default_vmode); | 1329 | fb_videomode_to_var(&info->var, default_vmode); |
1347 | dlfb_var_color_format(&info->var); | 1330 | dlfb_var_color_format(&info->var); |
@@ -1353,13 +1336,13 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1353 | info->fix.line_length = info->var.xres * | 1336 | info->fix.line_length = info->var.xres * |
1354 | (info->var.bits_per_pixel / 8); | 1337 | (info->var.bits_per_pixel / 8); |
1355 | 1338 | ||
1356 | result = dlfb_realloc_framebuffer(dev, info); | 1339 | result = dlfb_realloc_framebuffer(dlfb, info); |
1357 | 1340 | ||
1358 | } else | 1341 | } else |
1359 | result = -EINVAL; | 1342 | result = -EINVAL; |
1360 | 1343 | ||
1361 | error: | 1344 | error: |
1362 | if (edid && (dev->edid != edid)) | 1345 | if (edid && (dlfb->edid != edid)) |
1363 | kfree(edid); | 1346 | kfree(edid); |
1364 | 1347 | ||
1365 | if (info->dev) | 1348 | if (info->dev) |
@@ -1371,33 +1354,33 @@ error: | |||
1371 | static ssize_t metrics_bytes_rendered_show(struct device *fbdev, | 1354 | static ssize_t metrics_bytes_rendered_show(struct device *fbdev, |
1372 | struct device_attribute *a, char *buf) { | 1355 | struct device_attribute *a, char *buf) { |
1373 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1356 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1374 | struct dlfb_data *dev = fb_info->par; | 1357 | struct dlfb_data *dlfb = fb_info->par; |
1375 | return snprintf(buf, PAGE_SIZE, "%u\n", | 1358 | return snprintf(buf, PAGE_SIZE, "%u\n", |
1376 | atomic_read(&dev->bytes_rendered)); | 1359 | atomic_read(&dlfb->bytes_rendered)); |
1377 | } | 1360 | } |
1378 | 1361 | ||
1379 | static ssize_t metrics_bytes_identical_show(struct device *fbdev, | 1362 | static ssize_t metrics_bytes_identical_show(struct device *fbdev, |
1380 | struct device_attribute *a, char *buf) { | 1363 | struct device_attribute *a, char *buf) { |
1381 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1364 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1382 | struct dlfb_data *dev = fb_info->par; | 1365 | struct dlfb_data *dlfb = fb_info->par; |
1383 | return snprintf(buf, PAGE_SIZE, "%u\n", | 1366 | return snprintf(buf, PAGE_SIZE, "%u\n", |
1384 | atomic_read(&dev->bytes_identical)); | 1367 | atomic_read(&dlfb->bytes_identical)); |
1385 | } | 1368 | } |
1386 | 1369 | ||
1387 | static ssize_t metrics_bytes_sent_show(struct device *fbdev, | 1370 | static ssize_t metrics_bytes_sent_show(struct device *fbdev, |
1388 | struct device_attribute *a, char *buf) { | 1371 | struct device_attribute *a, char *buf) { |
1389 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1372 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1390 | struct dlfb_data *dev = fb_info->par; | 1373 | struct dlfb_data *dlfb = fb_info->par; |
1391 | return snprintf(buf, PAGE_SIZE, "%u\n", | 1374 | return snprintf(buf, PAGE_SIZE, "%u\n", |
1392 | atomic_read(&dev->bytes_sent)); | 1375 | atomic_read(&dlfb->bytes_sent)); |
1393 | } | 1376 | } |
1394 | 1377 | ||
1395 | static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, | 1378 | static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, |
1396 | struct device_attribute *a, char *buf) { | 1379 | struct device_attribute *a, char *buf) { |
1397 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1380 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1398 | struct dlfb_data *dev = fb_info->par; | 1381 | struct dlfb_data *dlfb = fb_info->par; |
1399 | return snprintf(buf, PAGE_SIZE, "%u\n", | 1382 | return snprintf(buf, PAGE_SIZE, "%u\n", |
1400 | atomic_read(&dev->cpu_kcycles_used)); | 1383 | atomic_read(&dlfb->cpu_kcycles_used)); |
1401 | } | 1384 | } |
1402 | 1385 | ||
1403 | static ssize_t edid_show( | 1386 | static ssize_t edid_show( |
@@ -1406,21 +1389,18 @@ static ssize_t edid_show( | |||
1406 | char *buf, loff_t off, size_t count) { | 1389 | char *buf, loff_t off, size_t count) { |
1407 | struct device *fbdev = container_of(kobj, struct device, kobj); | 1390 | struct device *fbdev = container_of(kobj, struct device, kobj); |
1408 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1391 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1409 | struct dlfb_data *dev = fb_info->par; | 1392 | struct dlfb_data *dlfb = fb_info->par; |
1410 | 1393 | ||
1411 | if (dev->edid == NULL) | 1394 | if (dlfb->edid == NULL) |
1412 | return 0; | 1395 | return 0; |
1413 | 1396 | ||
1414 | if ((off >= dev->edid_size) || (count > dev->edid_size)) | 1397 | if ((off >= dlfb->edid_size) || (count > dlfb->edid_size)) |
1415 | return 0; | 1398 | return 0; |
1416 | 1399 | ||
1417 | if (off + count > dev->edid_size) | 1400 | if (off + count > dlfb->edid_size) |
1418 | count = dev->edid_size - off; | 1401 | count = dlfb->edid_size - off; |
1419 | |||
1420 | pr_info("sysfs edid copy %p to %p, %d bytes\n", | ||
1421 | dev->edid, buf, (int) count); | ||
1422 | 1402 | ||
1423 | memcpy(buf, dev->edid, count); | 1403 | memcpy(buf, dlfb->edid, count); |
1424 | 1404 | ||
1425 | return count; | 1405 | return count; |
1426 | } | 1406 | } |
@@ -1431,21 +1411,20 @@ static ssize_t edid_store( | |||
1431 | char *src, loff_t src_off, size_t src_size) { | 1411 | char *src, loff_t src_off, size_t src_size) { |
1432 | struct device *fbdev = container_of(kobj, struct device, kobj); | 1412 | struct device *fbdev = container_of(kobj, struct device, kobj); |
1433 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1413 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1434 | struct dlfb_data *dev = fb_info->par; | 1414 | struct dlfb_data *dlfb = fb_info->par; |
1435 | int ret; | 1415 | int ret; |
1436 | 1416 | ||
1437 | /* We only support write of entire EDID at once, no offset*/ | 1417 | /* We only support write of entire EDID at once, no offset*/ |
1438 | if ((src_size != EDID_LENGTH) || (src_off != 0)) | 1418 | if ((src_size != EDID_LENGTH) || (src_off != 0)) |
1439 | return -EINVAL; | 1419 | return -EINVAL; |
1440 | 1420 | ||
1441 | ret = dlfb_setup_modes(dev, fb_info, src, src_size); | 1421 | ret = dlfb_setup_modes(dlfb, fb_info, src, src_size); |
1442 | if (ret) | 1422 | if (ret) |
1443 | return ret; | 1423 | return ret; |
1444 | 1424 | ||
1445 | if (!dev->edid || memcmp(src, dev->edid, src_size)) | 1425 | if (!dlfb->edid || memcmp(src, dlfb->edid, src_size)) |
1446 | return -EINVAL; | 1426 | return -EINVAL; |
1447 | 1427 | ||
1448 | pr_info("sysfs written EDID is new default\n"); | ||
1449 | dlfb_ops_set_par(fb_info); | 1428 | dlfb_ops_set_par(fb_info); |
1450 | return src_size; | 1429 | return src_size; |
1451 | } | 1430 | } |
@@ -1455,12 +1434,12 @@ static ssize_t metrics_reset_store(struct device *fbdev, | |||
1455 | const char *buf, size_t count) | 1434 | const char *buf, size_t count) |
1456 | { | 1435 | { |
1457 | struct fb_info *fb_info = dev_get_drvdata(fbdev); | 1436 | struct fb_info *fb_info = dev_get_drvdata(fbdev); |
1458 | struct dlfb_data *dev = fb_info->par; | 1437 | struct dlfb_data *dlfb = fb_info->par; |
1459 | 1438 | ||
1460 | atomic_set(&dev->bytes_rendered, 0); | 1439 | atomic_set(&dlfb->bytes_rendered, 0); |
1461 | atomic_set(&dev->bytes_identical, 0); | 1440 | atomic_set(&dlfb->bytes_identical, 0); |
1462 | atomic_set(&dev->bytes_sent, 0); | 1441 | atomic_set(&dlfb->bytes_sent, 0); |
1463 | atomic_set(&dev->cpu_kcycles_used, 0); | 1442 | atomic_set(&dlfb->cpu_kcycles_used, 0); |
1464 | 1443 | ||
1465 | return count; | 1444 | return count; |
1466 | } | 1445 | } |
@@ -1473,7 +1452,7 @@ static const struct bin_attribute edid_attr = { | |||
1473 | .write = edid_store | 1452 | .write = edid_store |
1474 | }; | 1453 | }; |
1475 | 1454 | ||
1476 | static struct device_attribute fb_device_attrs[] = { | 1455 | static const struct device_attribute fb_device_attrs[] = { |
1477 | __ATTR_RO(metrics_bytes_rendered), | 1456 | __ATTR_RO(metrics_bytes_rendered), |
1478 | __ATTR_RO(metrics_bytes_identical), | 1457 | __ATTR_RO(metrics_bytes_identical), |
1479 | __ATTR_RO(metrics_bytes_sent), | 1458 | __ATTR_RO(metrics_bytes_sent), |
@@ -1484,7 +1463,7 @@ static struct device_attribute fb_device_attrs[] = { | |||
1484 | /* | 1463 | /* |
1485 | * This is necessary before we can communicate with the display controller. | 1464 | * This is necessary before we can communicate with the display controller. |
1486 | */ | 1465 | */ |
1487 | static int dlfb_select_std_channel(struct dlfb_data *dev) | 1466 | static int dlfb_select_std_channel(struct dlfb_data *dlfb) |
1488 | { | 1467 | { |
1489 | int ret; | 1468 | int ret; |
1490 | void *buf; | 1469 | void *buf; |
@@ -1499,7 +1478,7 @@ static int dlfb_select_std_channel(struct dlfb_data *dev) | |||
1499 | if (!buf) | 1478 | if (!buf) |
1500 | return -ENOMEM; | 1479 | return -ENOMEM; |
1501 | 1480 | ||
1502 | ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), | 1481 | ret = usb_control_msg(dlfb->udev, usb_sndctrlpipe(dlfb->udev, 0), |
1503 | NR_USB_REQUEST_CHANNEL, | 1482 | NR_USB_REQUEST_CHANNEL, |
1504 | (USB_DIR_OUT | USB_TYPE_VENDOR), 0, 0, | 1483 | (USB_DIR_OUT | USB_TYPE_VENDOR), 0, 0, |
1505 | buf, sizeof(set_def_chn), USB_CTRL_SET_TIMEOUT); | 1484 | buf, sizeof(set_def_chn), USB_CTRL_SET_TIMEOUT); |
@@ -1509,8 +1488,8 @@ static int dlfb_select_std_channel(struct dlfb_data *dev) | |||
1509 | return ret; | 1488 | return ret; |
1510 | } | 1489 | } |
1511 | 1490 | ||
1512 | static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | 1491 | static int dlfb_parse_vendor_descriptor(struct dlfb_data *dlfb, |
1513 | struct usb_interface *interface) | 1492 | struct usb_interface *intf) |
1514 | { | 1493 | { |
1515 | char *desc; | 1494 | char *desc; |
1516 | char *buf; | 1495 | char *buf; |
@@ -1522,20 +1501,21 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | |||
1522 | return false; | 1501 | return false; |
1523 | desc = buf; | 1502 | desc = buf; |
1524 | 1503 | ||
1525 | total_len = usb_get_descriptor(interface_to_usbdev(interface), | 1504 | total_len = usb_get_descriptor(interface_to_usbdev(intf), |
1526 | 0x5f, /* vendor specific */ | 1505 | 0x5f, /* vendor specific */ |
1527 | 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE); | 1506 | 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE); |
1528 | 1507 | ||
1529 | /* if not found, look in configuration descriptor */ | 1508 | /* if not found, look in configuration descriptor */ |
1530 | if (total_len < 0) { | 1509 | if (total_len < 0) { |
1531 | if (0 == usb_get_extra_descriptor(interface->cur_altsetting, | 1510 | if (0 == usb_get_extra_descriptor(intf->cur_altsetting, |
1532 | 0x5f, &desc)) | 1511 | 0x5f, &desc)) |
1533 | total_len = (int) desc[0]; | 1512 | total_len = (int) desc[0]; |
1534 | } | 1513 | } |
1535 | 1514 | ||
1536 | if (total_len > 5) { | 1515 | if (total_len > 5) { |
1537 | pr_info("vendor descriptor length:%x data:%11ph\n", total_len, | 1516 | dev_info(&intf->dev, |
1538 | desc); | 1517 | "vendor descriptor length: %d data: %11ph\n", |
1518 | total_len, desc); | ||
1539 | 1519 | ||
1540 | if ((desc[0] != total_len) || /* descriptor length */ | 1520 | if ((desc[0] != total_len) || /* descriptor length */ |
1541 | (desc[1] != 0x5f) || /* vendor descriptor type */ | 1521 | (desc[1] != 0x5f) || /* vendor descriptor type */ |
@@ -1560,9 +1540,10 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | |||
1560 | case 0x0200: { /* max_area */ | 1540 | case 0x0200: { /* max_area */ |
1561 | u32 max_area; | 1541 | u32 max_area; |
1562 | max_area = le32_to_cpu(*((u32 *)desc)); | 1542 | max_area = le32_to_cpu(*((u32 *)desc)); |
1563 | pr_warn("DL chip limited to %d pixel modes\n", | 1543 | dev_warn(&intf->dev, |
1564 | max_area); | 1544 | "DL chip limited to %d pixel modes\n", |
1565 | dev->sku_pixel_limit = max_area; | 1545 | max_area); |
1546 | dlfb->sku_pixel_limit = max_area; | ||
1566 | break; | 1547 | break; |
1567 | } | 1548 | } |
1568 | default: | 1549 | default: |
@@ -1571,14 +1552,15 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | |||
1571 | desc += length; | 1552 | desc += length; |
1572 | } | 1553 | } |
1573 | } else { | 1554 | } else { |
1574 | pr_info("vendor descriptor not available (%d)\n", total_len); | 1555 | dev_info(&intf->dev, "vendor descriptor not available (%d)\n", |
1556 | total_len); | ||
1575 | } | 1557 | } |
1576 | 1558 | ||
1577 | goto success; | 1559 | goto success; |
1578 | 1560 | ||
1579 | unrecognized: | 1561 | unrecognized: |
1580 | /* allow udlfb to load for now even if firmware unrecognized */ | 1562 | /* allow udlfb to load for now even if firmware unrecognized */ |
1581 | pr_err("Unrecognized vendor firmware descriptor\n"); | 1563 | dev_err(&intf->dev, "Unrecognized vendor firmware descriptor\n"); |
1582 | 1564 | ||
1583 | success: | 1565 | success: |
1584 | kfree(buf); | 1566 | kfree(buf); |
@@ -1587,75 +1569,66 @@ success: | |||
1587 | 1569 | ||
1588 | static void dlfb_init_framebuffer_work(struct work_struct *work); | 1570 | static void dlfb_init_framebuffer_work(struct work_struct *work); |
1589 | 1571 | ||
1590 | static int dlfb_usb_probe(struct usb_interface *interface, | 1572 | static int dlfb_usb_probe(struct usb_interface *intf, |
1591 | const struct usb_device_id *id) | 1573 | const struct usb_device_id *id) |
1592 | { | 1574 | { |
1593 | struct usb_device *usbdev; | 1575 | struct dlfb_data *dlfb; |
1594 | struct dlfb_data *dev; | ||
1595 | int retval = -ENOMEM; | 1576 | int retval = -ENOMEM; |
1577 | struct usb_device *usbdev = interface_to_usbdev(intf); | ||
1596 | 1578 | ||
1597 | /* usb initialization */ | 1579 | /* usb initialization */ |
1598 | 1580 | dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL); | |
1599 | usbdev = interface_to_usbdev(interface); | 1581 | if (!dlfb) { |
1600 | 1582 | dev_err(&intf->dev, "%s: failed to allocate dlfb\n", __func__); | |
1601 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | ||
1602 | if (dev == NULL) { | ||
1603 | dev_err(&interface->dev, "dlfb_usb_probe: failed alloc of dev struct\n"); | ||
1604 | goto error; | 1583 | goto error; |
1605 | } | 1584 | } |
1606 | 1585 | ||
1607 | kref_init(&dev->kref); /* matching kref_put in usb .disconnect fn */ | 1586 | kref_init(&dlfb->kref); /* matching kref_put in usb .disconnect fn */ |
1608 | 1587 | ||
1609 | dev->udev = usbdev; | 1588 | dlfb->udev = usbdev; |
1610 | dev->gdev = &usbdev->dev; /* our generic struct device * */ | 1589 | usb_set_intfdata(intf, dlfb); |
1611 | usb_set_intfdata(interface, dev); | ||
1612 | 1590 | ||
1613 | pr_info("%s %s - serial #%s\n", | 1591 | dev_dbg(&intf->dev, "console enable=%d\n", console); |
1614 | usbdev->manufacturer, usbdev->product, usbdev->serial); | 1592 | dev_dbg(&intf->dev, "fb_defio enable=%d\n", fb_defio); |
1615 | pr_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n", | 1593 | dev_dbg(&intf->dev, "shadow enable=%d\n", shadow); |
1616 | le16_to_cpu(usbdev->descriptor.idVendor), | ||
1617 | le16_to_cpu(usbdev->descriptor.idProduct), | ||
1618 | le16_to_cpu(usbdev->descriptor.bcdDevice), dev); | ||
1619 | pr_info("console enable=%d\n", console); | ||
1620 | pr_info("fb_defio enable=%d\n", fb_defio); | ||
1621 | pr_info("shadow enable=%d\n", shadow); | ||
1622 | 1594 | ||
1623 | dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ | 1595 | dlfb->sku_pixel_limit = 2048 * 1152; /* default to maximum */ |
1624 | 1596 | ||
1625 | if (!dlfb_parse_vendor_descriptor(dev, interface)) { | 1597 | if (!dlfb_parse_vendor_descriptor(dlfb, intf)) { |
1626 | pr_err("firmware not recognized. Assume incompatible device\n"); | 1598 | dev_err(&intf->dev, |
1599 | "firmware not recognized, incompatible device?\n"); | ||
1627 | goto error; | 1600 | goto error; |
1628 | } | 1601 | } |
1629 | 1602 | ||
1630 | if (pixel_limit) { | 1603 | if (pixel_limit) { |
1631 | pr_warn("DL chip limit of %d overridden" | 1604 | dev_warn(&intf->dev, |
1632 | " by module param to %d\n", | 1605 | "DL chip limit of %d overridden to %d\n", |
1633 | dev->sku_pixel_limit, pixel_limit); | 1606 | dlfb->sku_pixel_limit, pixel_limit); |
1634 | dev->sku_pixel_limit = pixel_limit; | 1607 | dlfb->sku_pixel_limit = pixel_limit; |
1635 | } | 1608 | } |
1636 | 1609 | ||
1637 | 1610 | ||
1638 | if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { | 1611 | if (!dlfb_alloc_urb_list(dlfb, WRITES_IN_FLIGHT, MAX_TRANSFER)) { |
1639 | retval = -ENOMEM; | 1612 | retval = -ENOMEM; |
1640 | pr_err("dlfb_alloc_urb_list failed\n"); | 1613 | dev_err(&intf->dev, "unable to allocate urb list\n"); |
1641 | goto error; | 1614 | goto error; |
1642 | } | 1615 | } |
1643 | 1616 | ||
1644 | kref_get(&dev->kref); /* matching kref_put in free_framebuffer_work */ | 1617 | kref_get(&dlfb->kref); /* matching kref_put in free_framebuffer_work */ |
1645 | 1618 | ||
1646 | /* We don't register a new USB class. Our client interface is fbdev */ | 1619 | /* We don't register a new USB class. Our client interface is dlfbev */ |
1647 | 1620 | ||
1648 | /* Workitem keep things fast & simple during USB enumeration */ | 1621 | /* Workitem keep things fast & simple during USB enumeration */ |
1649 | INIT_DELAYED_WORK(&dev->init_framebuffer_work, | 1622 | INIT_DELAYED_WORK(&dlfb->init_framebuffer_work, |
1650 | dlfb_init_framebuffer_work); | 1623 | dlfb_init_framebuffer_work); |
1651 | schedule_delayed_work(&dev->init_framebuffer_work, 0); | 1624 | schedule_delayed_work(&dlfb->init_framebuffer_work, 0); |
1652 | 1625 | ||
1653 | return 0; | 1626 | return 0; |
1654 | 1627 | ||
1655 | error: | 1628 | error: |
1656 | if (dev) { | 1629 | if (dlfb) { |
1657 | 1630 | ||
1658 | kref_put(&dev->kref, dlfb_free); /* last ref from kref_init */ | 1631 | kref_put(&dlfb->kref, dlfb_free); /* last ref from kref_init */ |
1659 | 1632 | ||
1660 | /* dev has been deallocated. Do not dereference */ | 1633 | /* dev has been deallocated. Do not dereference */ |
1661 | } | 1634 | } |
@@ -1665,97 +1638,101 @@ error: | |||
1665 | 1638 | ||
1666 | static void dlfb_init_framebuffer_work(struct work_struct *work) | 1639 | static void dlfb_init_framebuffer_work(struct work_struct *work) |
1667 | { | 1640 | { |
1668 | struct dlfb_data *dev = container_of(work, struct dlfb_data, | 1641 | int i, retval; |
1669 | init_framebuffer_work.work); | ||
1670 | struct fb_info *info; | 1642 | struct fb_info *info; |
1671 | int retval; | 1643 | const struct device_attribute *attr; |
1672 | int i; | 1644 | struct dlfb_data *dlfb = container_of(work, struct dlfb_data, |
1645 | init_framebuffer_work.work); | ||
1673 | 1646 | ||
1674 | /* allocates framebuffer driver structure, not framebuffer memory */ | 1647 | /* allocates framebuffer driver structure, not framebuffer memory */ |
1675 | info = framebuffer_alloc(0, dev->gdev); | 1648 | info = framebuffer_alloc(0, &dlfb->udev->dev); |
1676 | if (!info) { | 1649 | if (!info) { |
1677 | pr_err("framebuffer_alloc failed\n"); | 1650 | dev_err(&dlfb->udev->dev, "framebuffer_alloc failed\n"); |
1678 | goto error; | 1651 | goto error; |
1679 | } | 1652 | } |
1680 | 1653 | ||
1681 | dev->info = info; | 1654 | dlfb->info = info; |
1682 | info->par = dev; | 1655 | info->par = dlfb; |
1683 | info->pseudo_palette = dev->pseudo_palette; | 1656 | info->pseudo_palette = dlfb->pseudo_palette; |
1684 | info->fbops = &dlfb_ops; | 1657 | info->fbops = &dlfb_ops; |
1685 | 1658 | ||
1686 | retval = fb_alloc_cmap(&info->cmap, 256, 0); | 1659 | retval = fb_alloc_cmap(&info->cmap, 256, 0); |
1687 | if (retval < 0) { | 1660 | if (retval < 0) { |
1688 | pr_err("fb_alloc_cmap failed %x\n", retval); | 1661 | dev_err(info->device, "cmap allocation failed: %d\n", retval); |
1689 | goto error; | 1662 | goto error; |
1690 | } | 1663 | } |
1691 | 1664 | ||
1692 | INIT_DELAYED_WORK(&dev->free_framebuffer_work, | 1665 | INIT_DELAYED_WORK(&dlfb->free_framebuffer_work, |
1693 | dlfb_free_framebuffer_work); | 1666 | dlfb_free_framebuffer_work); |
1694 | 1667 | ||
1695 | INIT_LIST_HEAD(&info->modelist); | 1668 | INIT_LIST_HEAD(&info->modelist); |
1696 | 1669 | ||
1697 | retval = dlfb_setup_modes(dev, info, NULL, 0); | 1670 | retval = dlfb_setup_modes(dlfb, info, NULL, 0); |
1698 | if (retval != 0) { | 1671 | if (retval != 0) { |
1699 | pr_err("unable to find common mode for display and adapter\n"); | 1672 | dev_err(info->device, |
1673 | "unable to find common mode for display and adapter\n"); | ||
1700 | goto error; | 1674 | goto error; |
1701 | } | 1675 | } |
1702 | 1676 | ||
1703 | /* ready to begin using device */ | 1677 | /* ready to begin using device */ |
1704 | 1678 | ||
1705 | atomic_set(&dev->usb_active, 1); | 1679 | atomic_set(&dlfb->usb_active, 1); |
1706 | dlfb_select_std_channel(dev); | 1680 | dlfb_select_std_channel(dlfb); |
1707 | 1681 | ||
1708 | dlfb_ops_check_var(&info->var, info); | 1682 | dlfb_ops_check_var(&info->var, info); |
1709 | dlfb_ops_set_par(info); | 1683 | dlfb_ops_set_par(info); |
1710 | 1684 | ||
1711 | retval = register_framebuffer(info); | 1685 | retval = register_framebuffer(info); |
1712 | if (retval < 0) { | 1686 | if (retval < 0) { |
1713 | pr_err("register_framebuffer failed %d\n", retval); | 1687 | dev_err(info->device, "unable to register framebuffer: %d\n", |
1688 | retval); | ||
1714 | goto error; | 1689 | goto error; |
1715 | } | 1690 | } |
1716 | 1691 | ||
1717 | for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) { | 1692 | for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) { |
1718 | retval = device_create_file(info->dev, &fb_device_attrs[i]); | 1693 | attr = &fb_device_attrs[i]; |
1719 | if (retval) { | 1694 | retval = device_create_file(info->dev, attr); |
1720 | pr_warn("device_create_file failed %d\n", retval); | 1695 | if (retval) |
1721 | } | 1696 | dev_warn(info->device, |
1697 | "failed to create '%s' attribute: %d\n", | ||
1698 | attr->attr.name, retval); | ||
1722 | } | 1699 | } |
1723 | 1700 | ||
1724 | retval = device_create_bin_file(info->dev, &edid_attr); | 1701 | retval = device_create_bin_file(info->dev, &edid_attr); |
1725 | if (retval) { | 1702 | if (retval) |
1726 | pr_warn("device_create_bin_file failed %d\n", retval); | 1703 | dev_warn(info->device, "failed to create '%s' attribute: %d\n", |
1727 | } | 1704 | edid_attr.attr.name, retval); |
1728 | 1705 | ||
1729 | pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." | 1706 | dev_info(info->device, |
1730 | " Using %dK framebuffer memory\n", info->node, | 1707 | "%s is DisplayLink USB device (%dx%d, %dK framebuffer memory)\n", |
1731 | info->var.xres, info->var.yres, | 1708 | dev_name(info->dev), info->var.xres, info->var.yres, |
1732 | ((dev->backing_buffer) ? | 1709 | ((dlfb->backing_buffer) ? |
1733 | info->fix.smem_len * 2 : info->fix.smem_len) >> 10); | 1710 | info->fix.smem_len * 2 : info->fix.smem_len) >> 10); |
1734 | return; | 1711 | return; |
1735 | 1712 | ||
1736 | error: | 1713 | error: |
1737 | dlfb_free_framebuffer(dev); | 1714 | dlfb_free_framebuffer(dlfb); |
1738 | } | 1715 | } |
1739 | 1716 | ||
1740 | static void dlfb_usb_disconnect(struct usb_interface *interface) | 1717 | static void dlfb_usb_disconnect(struct usb_interface *intf) |
1741 | { | 1718 | { |
1742 | struct dlfb_data *dev; | 1719 | struct dlfb_data *dlfb; |
1743 | struct fb_info *info; | 1720 | struct fb_info *info; |
1744 | int i; | 1721 | int i; |
1745 | 1722 | ||
1746 | dev = usb_get_intfdata(interface); | 1723 | dlfb = usb_get_intfdata(intf); |
1747 | info = dev->info; | 1724 | info = dlfb->info; |
1748 | 1725 | ||
1749 | pr_info("USB disconnect starting\n"); | 1726 | dev_dbg(&intf->dev, "USB disconnect starting\n"); |
1750 | 1727 | ||
1751 | /* we virtualize until all fb clients release. Then we free */ | 1728 | /* we virtualize until all fb clients release. Then we free */ |
1752 | dev->virtualized = true; | 1729 | dlfb->virtualized = true; |
1753 | 1730 | ||
1754 | /* When non-active we'll update virtual framebuffer, but no new urbs */ | 1731 | /* When non-active we'll update virtual framebuffer, but no new urbs */ |
1755 | atomic_set(&dev->usb_active, 0); | 1732 | atomic_set(&dlfb->usb_active, 0); |
1756 | 1733 | ||
1757 | /* this function will wait for all in-flight urbs to complete */ | 1734 | /* this function will wait for all in-flight urbs to complete */ |
1758 | dlfb_free_urb_list(dev); | 1735 | dlfb_free_urb_list(dlfb); |
1759 | 1736 | ||
1760 | if (info) { | 1737 | if (info) { |
1761 | /* remove udlfb's sysfs interfaces */ | 1738 | /* remove udlfb's sysfs interfaces */ |
@@ -1765,20 +1742,17 @@ static void dlfb_usb_disconnect(struct usb_interface *interface) | |||
1765 | unlink_framebuffer(info); | 1742 | unlink_framebuffer(info); |
1766 | } | 1743 | } |
1767 | 1744 | ||
1768 | usb_set_intfdata(interface, NULL); | 1745 | usb_set_intfdata(intf, NULL); |
1769 | dev->udev = NULL; | 1746 | dlfb->udev = NULL; |
1770 | dev->gdev = NULL; | ||
1771 | 1747 | ||
1772 | /* if clients still have us open, will be freed on last close */ | 1748 | /* if clients still have us open, will be freed on last close */ |
1773 | if (dev->fb_count == 0) | 1749 | if (dlfb->fb_count == 0) |
1774 | schedule_delayed_work(&dev->free_framebuffer_work, 0); | 1750 | schedule_delayed_work(&dlfb->free_framebuffer_work, 0); |
1775 | 1751 | ||
1776 | /* release reference taken by kref_init in probe() */ | 1752 | /* release reference taken by kref_init in probe() */ |
1777 | kref_put(&dev->kref, dlfb_free); | 1753 | kref_put(&dlfb->kref, dlfb_free); |
1778 | 1754 | ||
1779 | /* consider dlfb_data freed */ | 1755 | /* consider dlfb_data freed */ |
1780 | |||
1781 | return; | ||
1782 | } | 1756 | } |
1783 | 1757 | ||
1784 | static struct usb_driver dlfb_driver = { | 1758 | static struct usb_driver dlfb_driver = { |
@@ -1793,26 +1767,32 @@ module_usb_driver(dlfb_driver); | |||
1793 | static void dlfb_urb_completion(struct urb *urb) | 1767 | static void dlfb_urb_completion(struct urb *urb) |
1794 | { | 1768 | { |
1795 | struct urb_node *unode = urb->context; | 1769 | struct urb_node *unode = urb->context; |
1796 | struct dlfb_data *dev = unode->dev; | 1770 | struct dlfb_data *dlfb = unode->dlfb; |
1797 | unsigned long flags; | 1771 | unsigned long flags; |
1798 | 1772 | ||
1799 | /* sync/async unlink faults aren't errors */ | 1773 | switch (urb->status) { |
1800 | if (urb->status) { | 1774 | case 0: |
1801 | if (!(urb->status == -ENOENT || | 1775 | /* success */ |
1802 | urb->status == -ECONNRESET || | 1776 | break; |
1803 | urb->status == -ESHUTDOWN)) { | 1777 | case -ECONNRESET: |
1804 | pr_err("%s - nonzero write bulk status received: %d\n", | 1778 | case -ENOENT: |
1805 | __func__, urb->status); | 1779 | case -ESHUTDOWN: |
1806 | atomic_set(&dev->lost_pixels, 1); | 1780 | /* sync/async unlink faults aren't errors */ |
1807 | } | 1781 | break; |
1782 | default: | ||
1783 | dev_err(&dlfb->udev->dev, | ||
1784 | "%s - nonzero write bulk status received: %d\n", | ||
1785 | __func__, urb->status); | ||
1786 | atomic_set(&dlfb->lost_pixels, 1); | ||
1787 | break; | ||
1808 | } | 1788 | } |
1809 | 1789 | ||
1810 | urb->transfer_buffer_length = dev->urbs.size; /* reset to actual */ | 1790 | urb->transfer_buffer_length = dlfb->urbs.size; /* reset to actual */ |
1811 | 1791 | ||
1812 | spin_lock_irqsave(&dev->urbs.lock, flags); | 1792 | spin_lock_irqsave(&dlfb->urbs.lock, flags); |
1813 | list_add_tail(&unode->entry, &dev->urbs.list); | 1793 | list_add_tail(&unode->entry, &dlfb->urbs.list); |
1814 | dev->urbs.available++; | 1794 | dlfb->urbs.available++; |
1815 | spin_unlock_irqrestore(&dev->urbs.lock, flags); | 1795 | spin_unlock_irqrestore(&dlfb->urbs.lock, flags); |
1816 | 1796 | ||
1817 | /* | 1797 | /* |
1818 | * When using fb_defio, we deadlock if up() is called | 1798 | * When using fb_defio, we deadlock if up() is called |
@@ -1821,65 +1801,63 @@ static void dlfb_urb_completion(struct urb *urb) | |||
1821 | if (fb_defio) | 1801 | if (fb_defio) |
1822 | schedule_delayed_work(&unode->release_urb_work, 0); | 1802 | schedule_delayed_work(&unode->release_urb_work, 0); |
1823 | else | 1803 | else |
1824 | up(&dev->urbs.limit_sem); | 1804 | up(&dlfb->urbs.limit_sem); |
1825 | } | 1805 | } |
1826 | 1806 | ||
1827 | static void dlfb_free_urb_list(struct dlfb_data *dev) | 1807 | static void dlfb_free_urb_list(struct dlfb_data *dlfb) |
1828 | { | 1808 | { |
1829 | int count = dev->urbs.count; | 1809 | int count = dlfb->urbs.count; |
1830 | struct list_head *node; | 1810 | struct list_head *node; |
1831 | struct urb_node *unode; | 1811 | struct urb_node *unode; |
1832 | struct urb *urb; | 1812 | struct urb *urb; |
1833 | int ret; | 1813 | int ret; |
1834 | unsigned long flags; | 1814 | unsigned long flags; |
1835 | 1815 | ||
1836 | pr_notice("Freeing all render urbs\n"); | ||
1837 | |||
1838 | /* keep waiting and freeing, until we've got 'em all */ | 1816 | /* keep waiting and freeing, until we've got 'em all */ |
1839 | while (count--) { | 1817 | while (count--) { |
1840 | 1818 | ||
1841 | /* Getting interrupted means a leak, but ok at disconnect */ | 1819 | /* Getting interrupted means a leak, but ok at disconnect */ |
1842 | ret = down_interruptible(&dev->urbs.limit_sem); | 1820 | ret = down_interruptible(&dlfb->urbs.limit_sem); |
1843 | if (ret) | 1821 | if (ret) |
1844 | break; | 1822 | break; |
1845 | 1823 | ||
1846 | spin_lock_irqsave(&dev->urbs.lock, flags); | 1824 | spin_lock_irqsave(&dlfb->urbs.lock, flags); |
1847 | 1825 | ||
1848 | node = dev->urbs.list.next; /* have reserved one with sem */ | 1826 | node = dlfb->urbs.list.next; /* have reserved one with sem */ |
1849 | list_del_init(node); | 1827 | list_del_init(node); |
1850 | 1828 | ||
1851 | spin_unlock_irqrestore(&dev->urbs.lock, flags); | 1829 | spin_unlock_irqrestore(&dlfb->urbs.lock, flags); |
1852 | 1830 | ||
1853 | unode = list_entry(node, struct urb_node, entry); | 1831 | unode = list_entry(node, struct urb_node, entry); |
1854 | urb = unode->urb; | 1832 | urb = unode->urb; |
1855 | 1833 | ||
1856 | /* Free each separately allocated piece */ | 1834 | /* Free each separately allocated piece */ |
1857 | usb_free_coherent(urb->dev, dev->urbs.size, | 1835 | usb_free_coherent(urb->dev, dlfb->urbs.size, |
1858 | urb->transfer_buffer, urb->transfer_dma); | 1836 | urb->transfer_buffer, urb->transfer_dma); |
1859 | usb_free_urb(urb); | 1837 | usb_free_urb(urb); |
1860 | kfree(node); | 1838 | kfree(node); |
1861 | } | 1839 | } |
1862 | 1840 | ||
1863 | dev->urbs.count = 0; | 1841 | dlfb->urbs.count = 0; |
1864 | } | 1842 | } |
1865 | 1843 | ||
1866 | static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size) | 1844 | static int dlfb_alloc_urb_list(struct dlfb_data *dlfb, int count, size_t size) |
1867 | { | 1845 | { |
1868 | int i = 0; | 1846 | int i = 0; |
1869 | struct urb *urb; | 1847 | struct urb *urb; |
1870 | struct urb_node *unode; | 1848 | struct urb_node *unode; |
1871 | char *buf; | 1849 | char *buf; |
1872 | 1850 | ||
1873 | spin_lock_init(&dev->urbs.lock); | 1851 | spin_lock_init(&dlfb->urbs.lock); |
1874 | 1852 | ||
1875 | dev->urbs.size = size; | 1853 | dlfb->urbs.size = size; |
1876 | INIT_LIST_HEAD(&dev->urbs.list); | 1854 | INIT_LIST_HEAD(&dlfb->urbs.list); |
1877 | 1855 | ||
1878 | while (i < count) { | 1856 | while (i < count) { |
1879 | unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); | 1857 | unode = kzalloc(sizeof(*unode), GFP_KERNEL); |
1880 | if (!unode) | 1858 | if (!unode) |
1881 | break; | 1859 | break; |
1882 | unode->dev = dev; | 1860 | unode->dlfb = dlfb; |
1883 | 1861 | ||
1884 | INIT_DELAYED_WORK(&unode->release_urb_work, | 1862 | INIT_DELAYED_WORK(&unode->release_urb_work, |
1885 | dlfb_release_urb_work); | 1863 | dlfb_release_urb_work); |
@@ -1891,7 +1869,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size) | |||
1891 | } | 1869 | } |
1892 | unode->urb = urb; | 1870 | unode->urb = urb; |
1893 | 1871 | ||
1894 | buf = usb_alloc_coherent(dev->udev, MAX_TRANSFER, GFP_KERNEL, | 1872 | buf = usb_alloc_coherent(dlfb->udev, MAX_TRANSFER, GFP_KERNEL, |
1895 | &urb->transfer_dma); | 1873 | &urb->transfer_dma); |
1896 | if (!buf) { | 1874 | if (!buf) { |
1897 | kfree(unode); | 1875 | kfree(unode); |
@@ -1900,69 +1878,64 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size) | |||
1900 | } | 1878 | } |
1901 | 1879 | ||
1902 | /* urb->transfer_buffer_length set to actual before submit */ | 1880 | /* urb->transfer_buffer_length set to actual before submit */ |
1903 | usb_fill_bulk_urb(urb, dev->udev, usb_sndbulkpipe(dev->udev, 1), | 1881 | usb_fill_bulk_urb(urb, dlfb->udev, usb_sndbulkpipe(dlfb->udev, 1), |
1904 | buf, size, dlfb_urb_completion, unode); | 1882 | buf, size, dlfb_urb_completion, unode); |
1905 | urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 1883 | urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
1906 | 1884 | ||
1907 | list_add_tail(&unode->entry, &dev->urbs.list); | 1885 | list_add_tail(&unode->entry, &dlfb->urbs.list); |
1908 | 1886 | ||
1909 | i++; | 1887 | i++; |
1910 | } | 1888 | } |
1911 | 1889 | ||
1912 | sema_init(&dev->urbs.limit_sem, i); | 1890 | sema_init(&dlfb->urbs.limit_sem, i); |
1913 | dev->urbs.count = i; | 1891 | dlfb->urbs.count = i; |
1914 | dev->urbs.available = i; | 1892 | dlfb->urbs.available = i; |
1915 | |||
1916 | pr_notice("allocated %d %d byte urbs\n", i, (int) size); | ||
1917 | 1893 | ||
1918 | return i; | 1894 | return i; |
1919 | } | 1895 | } |
1920 | 1896 | ||
1921 | static struct urb *dlfb_get_urb(struct dlfb_data *dev) | 1897 | static struct urb *dlfb_get_urb(struct dlfb_data *dlfb) |
1922 | { | 1898 | { |
1923 | int ret; | 1899 | int ret; |
1924 | struct list_head *entry; | 1900 | struct list_head *entry; |
1925 | struct urb_node *unode; | 1901 | struct urb_node *unode; |
1926 | struct urb *urb = NULL; | ||
1927 | unsigned long flags; | 1902 | unsigned long flags; |
1928 | 1903 | ||
1929 | /* Wait for an in-flight buffer to complete and get re-queued */ | 1904 | /* Wait for an in-flight buffer to complete and get re-queued */ |
1930 | ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT); | 1905 | ret = down_timeout(&dlfb->urbs.limit_sem, GET_URB_TIMEOUT); |
1931 | if (ret) { | 1906 | if (ret) { |
1932 | atomic_set(&dev->lost_pixels, 1); | 1907 | atomic_set(&dlfb->lost_pixels, 1); |
1933 | pr_warn("wait for urb interrupted: %x available: %d\n", | 1908 | dev_warn(&dlfb->udev->dev, |
1934 | ret, dev->urbs.available); | 1909 | "wait for urb interrupted: %d available: %d\n", |
1935 | goto error; | 1910 | ret, dlfb->urbs.available); |
1911 | return NULL; | ||
1936 | } | 1912 | } |
1937 | 1913 | ||
1938 | spin_lock_irqsave(&dev->urbs.lock, flags); | 1914 | spin_lock_irqsave(&dlfb->urbs.lock, flags); |
1939 | 1915 | ||
1940 | BUG_ON(list_empty(&dev->urbs.list)); /* reserved one with limit_sem */ | 1916 | BUG_ON(list_empty(&dlfb->urbs.list)); /* reserved one with limit_sem */ |
1941 | entry = dev->urbs.list.next; | 1917 | entry = dlfb->urbs.list.next; |
1942 | list_del_init(entry); | 1918 | list_del_init(entry); |
1943 | dev->urbs.available--; | 1919 | dlfb->urbs.available--; |
1944 | 1920 | ||
1945 | spin_unlock_irqrestore(&dev->urbs.lock, flags); | 1921 | spin_unlock_irqrestore(&dlfb->urbs.lock, flags); |
1946 | 1922 | ||
1947 | unode = list_entry(entry, struct urb_node, entry); | 1923 | unode = list_entry(entry, struct urb_node, entry); |
1948 | urb = unode->urb; | 1924 | return unode->urb; |
1949 | |||
1950 | error: | ||
1951 | return urb; | ||
1952 | } | 1925 | } |
1953 | 1926 | ||
1954 | static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len) | 1927 | static int dlfb_submit_urb(struct dlfb_data *dlfb, struct urb *urb, size_t len) |
1955 | { | 1928 | { |
1956 | int ret; | 1929 | int ret; |
1957 | 1930 | ||
1958 | BUG_ON(len > dev->urbs.size); | 1931 | BUG_ON(len > dlfb->urbs.size); |
1959 | 1932 | ||
1960 | urb->transfer_buffer_length = len; /* set to actual payload len */ | 1933 | urb->transfer_buffer_length = len; /* set to actual payload len */ |
1961 | ret = usb_submit_urb(urb, GFP_KERNEL); | 1934 | ret = usb_submit_urb(urb, GFP_KERNEL); |
1962 | if (ret) { | 1935 | if (ret) { |
1963 | dlfb_urb_completion(urb); /* because no one else will */ | 1936 | dlfb_urb_completion(urb); /* because no one else will */ |
1964 | atomic_set(&dev->lost_pixels, 1); | 1937 | atomic_set(&dlfb->lost_pixels, 1); |
1965 | pr_err("usb_submit_urb error %x\n", ret); | 1938 | dev_err(&dlfb->udev->dev, "submit urb error: %d\n", ret); |
1966 | } | 1939 | } |
1967 | return ret; | 1940 | return ret; |
1968 | } | 1941 | } |
diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c index da653a080394..54127905bfe7 100644 --- a/drivers/video/fbdev/vfb.c +++ b/drivers/video/fbdev/vfb.c | |||
@@ -239,8 +239,23 @@ static int vfb_check_var(struct fb_var_screeninfo *var, | |||
239 | */ | 239 | */ |
240 | static int vfb_set_par(struct fb_info *info) | 240 | static int vfb_set_par(struct fb_info *info) |
241 | { | 241 | { |
242 | switch (info->var.bits_per_pixel) { | ||
243 | case 1: | ||
244 | info->fix.visual = FB_VISUAL_MONO01; | ||
245 | break; | ||
246 | case 8: | ||
247 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | ||
248 | break; | ||
249 | case 16: | ||
250 | case 24: | ||
251 | case 32: | ||
252 | info->fix.visual = FB_VISUAL_TRUECOLOR; | ||
253 | break; | ||
254 | } | ||
255 | |||
242 | info->fix.line_length = get_line_length(info->var.xres_virtual, | 256 | info->fix.line_length = get_line_length(info->var.xres_virtual, |
243 | info->var.bits_per_pixel); | 257 | info->var.bits_per_pixel); |
258 | |||
244 | return 0; | 259 | return 0; |
245 | } | 260 | } |
246 | 261 | ||
@@ -450,6 +465,8 @@ static int vfb_probe(struct platform_device *dev) | |||
450 | goto err2; | 465 | goto err2; |
451 | platform_set_drvdata(dev, info); | 466 | platform_set_drvdata(dev, info); |
452 | 467 | ||
468 | vfb_set_par(info); | ||
469 | |||
453 | fb_info(info, "Virtual frame buffer device, using %ldK of video memory\n", | 470 | fb_info(info, "Virtual frame buffer device, using %ldK of video memory\n", |
454 | videomemorysize >> 10); | 471 | videomemorysize >> 10); |
455 | return 0; | 472 | return 0; |
diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index 5f0690c8fc93..2c6a576ed84c 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c | |||
@@ -1055,7 +1055,6 @@ static void vga16fb_copyarea(struct fb_info *info, const struct fb_copyarea *are | |||
1055 | case FB_TYPE_VGA_PLANES: | 1055 | case FB_TYPE_VGA_PLANES: |
1056 | if (info->fix.type_aux == FB_AUX_VGA_PLANES_VGA4) { | 1056 | if (info->fix.type_aux == FB_AUX_VGA_PLANES_VGA4) { |
1057 | width = width/8; | 1057 | width = width/8; |
1058 | height = height; | ||
1059 | line_ofs = info->fix.line_length - width; | 1058 | line_ofs = info->fix.line_length - width; |
1060 | 1059 | ||
1061 | setmode(1); | 1060 | setmode(1); |
diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c index 1a1176bf0906..5c5cd2923041 100644 --- a/drivers/video/fbdev/vt8500lcdfb.c +++ b/drivers/video/fbdev/vt8500lcdfb.c | |||
@@ -289,10 +289,8 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
289 | 289 | ||
290 | fbi = devm_kzalloc(&pdev->dev, sizeof(struct vt8500lcd_info) | 290 | fbi = devm_kzalloc(&pdev->dev, sizeof(struct vt8500lcd_info) |
291 | + sizeof(u32) * 16, GFP_KERNEL); | 291 | + sizeof(u32) * 16, GFP_KERNEL); |
292 | if (!fbi) { | 292 | if (!fbi) |
293 | dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); | ||
294 | return -ENOMEM; | 293 | return -ENOMEM; |
295 | } | ||
296 | 294 | ||
297 | strcpy(fbi->fb.fix.id, "VT8500 LCD"); | 295 | strcpy(fbi->fb.fix.id, "VT8500 LCD"); |
298 | 296 | ||
diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c index 253ffe9baab2..8f0d5379861d 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c | |||
@@ -276,10 +276,8 @@ static int wm8505fb_probe(struct platform_device *pdev) | |||
276 | 276 | ||
277 | fbi = devm_kzalloc(&pdev->dev, sizeof(struct wm8505fb_info) + | 277 | fbi = devm_kzalloc(&pdev->dev, sizeof(struct wm8505fb_info) + |
278 | sizeof(u32) * 16, GFP_KERNEL); | 278 | sizeof(u32) * 16, GFP_KERNEL); |
279 | if (!fbi) { | 279 | if (!fbi) |
280 | dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); | ||
281 | return -ENOMEM; | 280 | return -ENOMEM; |
282 | } | ||
283 | 281 | ||
284 | strcpy(fbi->fb.fix.id, DRIVER_NAME); | 282 | strcpy(fbi->fb.fix.id, DRIVER_NAME); |
285 | 283 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index d1e5bed39140..f577d3c89618 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -569,7 +569,10 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { | |||
569 | #define fb_memcpy_fromfb sbus_memcpy_fromio | 569 | #define fb_memcpy_fromfb sbus_memcpy_fromio |
570 | #define fb_memcpy_tofb sbus_memcpy_toio | 570 | #define fb_memcpy_tofb sbus_memcpy_toio |
571 | 571 | ||
572 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) || defined(__arm__) | 572 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || \ |
573 | defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || \ | ||
574 | defined(__avr32__) || defined(__bfin__) || defined(__arm__) || \ | ||
575 | defined(__aarch64__) | ||
573 | 576 | ||
574 | #define fb_readb __raw_readb | 577 | #define fb_readb __raw_readb |
575 | #define fb_readw __raw_readw | 578 | #define fb_readw __raw_readw |
diff --git a/include/video/udlfb.h b/include/video/udlfb.h index 1252a7a89bc0..0cabe6b09095 100644 --- a/include/video/udlfb.h +++ b/include/video/udlfb.h | |||
@@ -19,7 +19,7 @@ struct dloarea { | |||
19 | 19 | ||
20 | struct urb_node { | 20 | struct urb_node { |
21 | struct list_head entry; | 21 | struct list_head entry; |
22 | struct dlfb_data *dev; | 22 | struct dlfb_data *dlfb; |
23 | struct delayed_work release_urb_work; | 23 | struct delayed_work release_urb_work; |
24 | struct urb *urb; | 24 | struct urb *urb; |
25 | }; | 25 | }; |
@@ -35,7 +35,6 @@ struct urb_list { | |||
35 | 35 | ||
36 | struct dlfb_data { | 36 | struct dlfb_data { |
37 | struct usb_device *udev; | 37 | struct usb_device *udev; |
38 | struct device *gdev; /* &udev->dev */ | ||
39 | struct fb_info *info; | 38 | struct fb_info *info; |
40 | struct urb_list urbs; | 39 | struct urb_list urbs; |
41 | struct kref kref; | 40 | struct kref kref; |