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

drm/gma500: Code cleanup - inline documentation

Improve readability by adding/changing inline documentation

Signed-off-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>

authored by

Arthur Borsboom and committed by
Patrik Jakobsson
9083eb38 f90cd811

+54 -106
+20 -5
drivers/gpu/drm/gma500/psb_drv.c
··· 39 39 static struct drm_driver driver; 40 40 static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); 41 41 42 + /* 43 + * The table below contains a mapping of the PCI vendor ID and the PCI Device ID 44 + * to the different groups of PowerVR 5-series chip designs 45 + * 46 + * 0x8086 = Intel Corporation 47 + * 48 + * PowerVR SGX535 - Poulsbo - Intel GMA 500, Intel Atom Z5xx 49 + * PowerVR SGX535 - Moorestown - Intel GMA 600 50 + * PowerVR SGX535 - Oaktrail - Intel GMA 600, Intel Atom Z6xx, E6xx 51 + * PowerVR SGX540 - Medfield - Intel Atom Z2460 52 + * PowerVR SGX544MP2 - Medfield - 53 + * PowerVR SGX545 - Cedartrail - Intel GMA 3600, Intel Atom D2500, N2600 54 + * PowerVR SGX545 - Cedartrail - Intel GMA 3650, Intel Atom D2550, D2700, 55 + * N2800 56 + */ 42 57 static DEFINE_PCI_DEVICE_TABLE(pciidlist) = { 43 58 { 0x8086, 0x8108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &psb_chip_ops }, 44 59 { 0x8086, 0x8109, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &psb_chip_ops }, 45 60 #if defined(CONFIG_DRM_GMA600) 46 - /* Atom E620 */ 47 61 { 0x8086, 0x4100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops }, 48 62 { 0x8086, 0x4101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops }, 49 63 { 0x8086, 0x4102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops }, ··· 165 151 { 166 152 struct drm_psb_private *dev_priv = dev->dev_private; 167 153 168 - /* Kill vblank etc here */ 169 - 154 + /* TODO: Kill vblank etc here */ 170 155 171 156 if (dev_priv) { 172 157 if (dev_priv->backlight_device) ··· 235 222 struct gma_encoder *gma_encoder; 236 223 struct psb_gtt *pg; 237 224 225 + /* allocating and initializing driver private data */ 238 226 dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL); 239 227 if (dev_priv == NULL) 240 228 return -ENOMEM; ··· 335 321 336 322 acpi_video_register(); 337 323 324 + /* Setup vertical blanking handling */ 338 325 ret = drm_vblank_init(dev, dev_priv->num_pipe); 339 326 if (ret) 340 327 goto out_err; ··· 381 366 return ret; 382 367 psb_intel_opregion_enable_asle(dev); 383 368 #if 0 384 - /*enable runtime pm at last*/ 369 + /* Enable runtime pm at last */ 385 370 pm_runtime_enable(&dev->pdev->dev); 386 371 pm_runtime_set_active(&dev->pdev->dev); 387 372 #endif 388 - /*Intel drm driver load is done, continue doing pvr load*/ 373 + /* Intel drm driver load is done, continue doing pvr load */ 389 374 return 0; 390 375 out_err: 391 376 psb_driver_unload(dev);
+34 -101
drivers/gpu/drm/gma500/psb_drv.h
··· 61 61 #define IS_MFLD(dev) (((dev)->pdev->device & 0xfff8) == 0x0130) 62 62 #define IS_CDV(dev) (((dev)->pdev->device & 0xfff0) == 0x0be0) 63 63 64 - 65 - /* 66 - * Hardware offsets 67 - */ 64 + /* Hardware offsets */ 68 65 #define PSB_VDC_OFFSET 0x00000000 69 66 #define PSB_VDC_SIZE 0x000080000 70 67 #define MRST_MMIO_SIZE 0x0000C0000 ··· 69 72 #define PSB_SGX_SIZE 0x8000 70 73 #define PSB_SGX_OFFSET 0x00040000 71 74 #define MRST_SGX_OFFSET 0x00080000 72 - /* 73 - * PCI resource identifiers 74 - */ 75 + 76 + /* PCI resource identifiers */ 75 77 #define PSB_MMIO_RESOURCE 0 76 78 #define PSB_AUX_RESOURCE 0 77 79 #define PSB_GATT_RESOURCE 2 78 80 #define PSB_GTT_RESOURCE 3 79 - /* 80 - * PCI configuration 81 - */ 81 + 82 + /* PCI configuration */ 82 83 #define PSB_GMCH_CTRL 0x52 83 84 #define PSB_BSM 0x5C 84 85 #define _PSB_GMCH_ENABLED 0x4 ··· 84 89 #define _PSB_PGETBL_ENABLED 0x00000001 85 90 #define PSB_SGX_2D_SLAVE_PORT 0x4000 86 91 87 - /* To get rid of */ 92 + /* TODO: To get rid of */ 88 93 #define PSB_TT_PRIV0_LIMIT (256*1024*1024) 89 94 #define PSB_TT_PRIV0_PLIMIT (PSB_TT_PRIV0_LIMIT >> PAGE_SHIFT) 90 95 91 - /* 92 - * SGX side MMU definitions (these can probably go) 93 - */ 96 + /* SGX side MMU definitions (these can probably go) */ 94 97 95 - /* 96 - * Flags for external memory type field. 97 - */ 98 + /* Flags for external memory type field */ 98 99 #define PSB_MMU_CACHED_MEMORY 0x0001 /* Bind to MMU only */ 99 100 #define PSB_MMU_RO_MEMORY 0x0002 /* MMU RO memory */ 100 101 #define PSB_MMU_WO_MEMORY 0x0004 /* MMU WO memory */ 101 - /* 102 - * PTE's and PDE's 103 - */ 102 + 103 + /* PTE's and PDE's */ 104 104 #define PSB_PDE_MASK 0x003FFFFF 105 105 #define PSB_PDE_SHIFT 22 106 106 #define PSB_PTE_SHIFT 12 107 - /* 108 - * Cache control 109 - */ 107 + 108 + /* Cache control */ 110 109 #define PSB_PTE_VALID 0x0001 /* PTE / PDE valid */ 111 110 #define PSB_PTE_WO 0x0002 /* Write only */ 112 111 #define PSB_PTE_RO 0x0004 /* Read only */ 113 112 #define PSB_PTE_CACHED 0x0008 /* CPU cache coherent */ 114 113 115 - /* 116 - * VDC registers and bits 117 - */ 114 + /* VDC registers and bits */ 118 115 #define PSB_MSVDX_CLOCKGATING 0x2064 119 116 #define PSB_TOPAZ_CLOCKGATING 0x2068 120 117 #define PSB_HWSTAM 0x2098 ··· 272 285 u32 reg0; 273 286 }; 274 287 275 - /* 276 - * Register offset maps 277 - */ 278 - 288 + /* Register offset maps */ 279 289 struct psb_offset { 280 290 u32 fp0; 281 291 u32 fp1; ··· 306 322 * update the register cache instead. 307 323 */ 308 324 309 - /* 310 - * Common status for pipes. 311 - */ 325 + /* Common status for pipes */ 312 326 struct psb_pipe { 313 327 u32 fp0; 314 328 u32 fp1; ··· 466 484 struct psb_mmu_driver *mmu; 467 485 struct psb_mmu_pd *pf_pd; 468 486 469 - /* 470 - * Register base 471 - */ 472 - 487 + /* Register base */ 473 488 uint8_t __iomem *sgx_reg; 474 489 uint8_t __iomem *vdc_reg; 475 490 uint8_t __iomem *aux_reg; /* Auxillary vdc pipe regs */ 476 491 uint32_t gatt_free_offset; 477 492 478 - /* 479 - * Fencing / irq. 480 - */ 481 - 493 + /* Fencing / irq */ 482 494 uint32_t vdc_irq_mask; 483 495 uint32_t pipestat[PSB_NUM_PIPE]; 484 496 485 497 spinlock_t irqmask_lock; 486 498 487 - /* 488 - * Power 489 - */ 490 - 499 + /* Power */ 491 500 bool suspended; 492 501 bool display_power; 493 502 int display_count; 494 503 495 - /* 496 - * Modesetting 497 - */ 504 + /* Modesetting */ 498 505 struct psb_intel_mode_device mode_dev; 499 506 bool modeset; /* true if we have done the mode_device setup */ 500 507 ··· 491 520 struct drm_crtc *pipe_to_crtc_mapping[PSB_NUM_PIPE]; 492 521 uint32_t num_pipe; 493 522 494 - /* 495 - * OSPM info (Power management base) (can go ?) 496 - */ 523 + /* OSPM info (Power management base) (TODO: can go ?) */ 497 524 uint32_t ospm_base; 498 525 499 - /* 500 - * Sizes info 501 - */ 502 - 526 + /* Sizes info */ 503 527 u32 fuse_reg_value; 504 528 u32 video_device_fuse; 505 529 ··· 514 548 struct drm_property *broadcast_rgb_property; 515 549 struct drm_property *force_audio_property; 516 550 517 - /* 518 - * LVDS info 519 - */ 551 + /* LVDS info */ 520 552 int backlight_duty_cycle; /* restore backlight to this value */ 521 553 bool panel_wants_dither; 522 554 struct drm_display_mode *panel_fixed_mode; ··· 548 584 /* Oaktrail HDMI state */ 549 585 struct oaktrail_hdmi_dev *hdmi_priv; 550 586 551 - /* 552 - * Register state 553 - */ 554 - 587 + /* Register state */ 555 588 struct psb_save_area regs; 556 589 557 590 /* MSI reg save */ 558 591 uint32_t msi_addr; 559 592 uint32_t msi_data; 560 593 561 - /* 562 - * Hotplug handling 563 - */ 564 - 594 + /* Hotplug handling */ 565 595 struct work_struct hotplug_work; 566 596 567 - /* 568 - * LID-Switch 569 - */ 597 + /* LID-Switch */ 570 598 spinlock_t lid_lock; 571 599 struct timer_list lid_timer; 572 600 struct psb_intel_opregion opregion; 573 601 u32 lid_last_state; 574 602 575 - /* 576 - * Watchdog 577 - */ 578 - 603 + /* Watchdog */ 579 604 uint32_t apm_reg; 580 605 uint16_t apm_base; 581 606 ··· 584 631 /* 2D acceleration */ 585 632 spinlock_t lock_2d; 586 633 587 - /* 588 - * Panel brightness 589 - */ 634 + /* Panel brightness */ 590 635 int brightness; 591 636 int brightness_adjusted; 592 637 ··· 617 666 }; 618 667 619 668 620 - /* 621 - * Operations for each board type 622 - */ 623 - 669 + /* Operations for each board type */ 624 670 struct psb_ops { 625 671 const char *name; 626 672 unsigned int accel_2d:1; ··· 671 723 return (struct drm_psb_private *) dev->dev_private; 672 724 } 673 725 674 - /* 675 - *psb_irq.c 676 - */ 677 - 726 + /* psb_irq.c */ 678 727 extern irqreturn_t psb_irq_handler(int irq, void *arg); 679 728 extern int psb_irq_enable_dpst(struct drm_device *dev); 680 729 extern int psb_irq_disable_dpst(struct drm_device *dev); ··· 694 749 695 750 extern u32 psb_get_vblank_counter(struct drm_device *dev, int crtc); 696 751 697 - /* 698 - * framebuffer.c 699 - */ 752 + /* framebuffer.c */ 700 753 extern int psbfb_probed(struct drm_device *dev); 701 754 extern int psbfb_remove(struct drm_device *dev, 702 755 struct drm_framebuffer *fb); 703 - /* 704 - * accel_2d.c 705 - */ 756 + /* accel_2d.c */ 706 757 extern void psbfb_copyarea(struct fb_info *info, 707 758 const struct fb_copyarea *region); 708 759 extern int psbfb_sync(struct fb_info *info); 709 760 extern void psb_spank(struct drm_psb_private *dev_priv); 710 761 711 - /* 712 - * psb_reset.c 713 - */ 714 - 762 + /* psb_reset.c */ 715 763 extern void psb_lid_timer_init(struct drm_psb_private *dev_priv); 716 764 extern void psb_lid_timer_takedown(struct drm_psb_private *dev_priv); 717 765 extern void psb_print_pagefault(struct drm_psb_private *dev_priv); ··· 763 825 /* cdv_device.c */ 764 826 extern const struct psb_ops cdv_chip_ops; 765 827 766 - /* 767 - * Debug print bits setting 768 - */ 828 + /* Debug print bits setting */ 769 829 #define PSB_D_GENERAL (1 << 0) 770 830 #define PSB_D_INIT (1 << 1) 771 831 #define PSB_D_IRQ (1 << 2) ··· 779 843 780 844 extern int drm_idle_check_interval; 781 845 782 - /* 783 - * Utilities 784 - */ 785 - 846 + /* Utilities */ 786 847 static inline u32 MRST_MSG_READ32(uint port, uint offset) 787 848 { 788 849 int mcr = (0xD0<<24) | (port << 16) | (offset << 8);