drm: drm_device house cleaning
Subsystems (12)
cover drm: drm_device house cleaning
This series does some house cleaning on struct drm_device.
x86-64:
pahole before the series:
/* size: 1576, cachelines: 25, members: 67 */
/* sum members: 1528, holes: 12, sum holes: 48 */
/* paddings: 3, sum paddings: 11 */
/* last cacheline: 40 bytes */pahole after the series:
/* size: 1296, cachelines: 21, members: 52 */
/* sum members: 1290, holes: 1, sum holes: 2 */
/* padding: 4 */
/* paddings: 3, sum paddings: 11 */
/* last cacheline: 16 bytes */x86:
pahole before the series:
/* size: 956, cachelines: 15, members: 67 */
/* sum members: 952, holes: 2, sum holes: 4 */
/* paddings: 3, sum paddings: 7 */
/* last cacheline: 60 bytes */pahole after the series:
/* size: 764, cachelines: 12, members: 52 */
/* sum members: 762, holes: 1, sum holes: 2 */
/* paddings: 3, sum paddings: 7 */
/* last cacheline: 60 bytes */Ville Syrjälä (10):
drm: Make vblank_disable_allowed bool
drm: Make vblank_inmodeset unsigned
drm: Make vblank_enabled bool
drm: Collect per-crtc vblank stuff to a struct
drm: Make irq_enabled bool
drm: Kill unused stuff from struct drm_device
drm: Kill ctx_count from struct drm_device
drm: Remove pci_vendor and pci_device from struct drm_device
drm: Kill drm perf counter leftovers
drm: Pack struct drm_device a bit better
drivers/gpu/drm/drm_context.c | 2 - drivers/gpu/drm/drm_drv.c | 6 -- drivers/gpu/drm/drm_fops.c | 3 - drivers/gpu/drm/drm_info.c | 6 +- drivers/gpu/drm/drm_irq.c | 152 ++++++++++------------------ drivers/gpu/drm/drm_lock.c | 3 - drivers/gpu/drm/drm_pci.c | 3 - drivers/gpu/drm/drm_stub.c | 9 -- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 +- drivers/gpu/drm/gma500/psb_drv.c | 2 +- drivers/gpu/drm/gma500/psb_drv.h | 8 +- drivers/gpu/drm/gma500/psb_irq.c | 22 ++-- drivers/gpu/drm/i810/i810_dma.c | 11 -- drivers/gpu/drm/i915/i915_dma.c | 11 +- drivers/gpu/drm/i915/i915_drv.h | 36 +++---- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 2 +- drivers/gpu/drm/i915/intel_tv.c | 2 +- drivers/gpu/drm/mga/mga_dma.c | 5 - drivers/gpu/drm/mga/mga_irq.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/arb.c | 8 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/disp.h | 6 +- drivers/gpu/drm/nouveau/dispnv04/hw.c | 4 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 4 +- drivers/gpu/drm/nouveau/nouveau_bios.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +- drivers/gpu/drm/omapdrm/omap_irq.c | 17 ++-- drivers/gpu/drm/radeon/radeon_bios.c | 6 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- drivers/gpu/drm/via/via_mm.c | 2 +- drivers/gpu/host1x/drm/drm.c | 2 +- drivers/staging/imx-drm/imx-drm-core.c | 8 +- include/drm/drmP.h | 62 ++++++------ 35 files changed, 171 insertions(+), 265 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/10 drm: Make vblank_disable_allowed bool
From: Ville Syrjälä <[email protected]>
vblank_disable_allowed is only ever 0 or 1, so make it a bool.
--- drivers/gpu/drm/drm_irq.c | 5 +++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++-- drivers/gpu/drm/gma500/psb_drv.c | 2 +- drivers/gpu/drm/i915/i915_dma.c | 2 +- drivers/staging/imx-drm/imx-drm-core.c | 4 ++-- include/drm/drmP.h | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/drm_irq.c +3 -2
@@ -271,7 +271,8 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)atomic_set (&dev->vblank_refcount[i],0 ); } - dev->vblank_disable_allowed =0 ; + dev->vblank_disable_allowed = false; +return 0 ; err:
@@ -1085,7 +1086,7 @@ void drm_vblank_post_modeset(struct drm_device *dev, int crtc)if (dev->vblank_inmodeset[crtc]) {spin_lock_irqsave (&dev->vbl_lock, irqflags); - dev->vblank_disable_allowed =1 ; + dev->vblank_disable_allowed = true;spin_unlock_irqrestore (&dev->vbl_lock, irqflags);if (dev->vblank_inmodeset[crtc] &0x2 )
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -2
@@ -725,11 +725,11 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev) drm_dev->irq_enabled =1 ;/* -* with vblank_disable_allowed = 1, vblank interrupt will be disabled +* with vblank_disable_allowed = true, vblank interrupt will be disabled * by drm timer once a current process gives up ownership of * vblank event.(after drm_vblank_put function is called) */ - drm_dev->vblank_disable_allowed =1 ; + drm_dev->vblank_disable_allowed = true;/* attach this sub driver to iommu mapping if supported. */ if (is_drm_iommu_supported (drm_dev))
drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 -2
@@ -394,11 +394,11 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) drm_dev->irq_enabled =1 ;/* -* with vblank_disable_allowed = 1, vblank interrupt will be disabled +* with vblank_disable_allowed = true, vblank interrupt will be disabled * by drm timer once a current process gives up ownership of * vblank event.(after drm_vblank_put function is called) */ - drm_dev->vblank_disable_allowed =1 ; + drm_dev->vblank_disable_allowed = true;return 0 ; }
drivers/gpu/drm/gma500/psb_drv.c +1 -1
@@ -359,7 +359,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)drm_irq_install (dev); - dev->vblank_disable_allowed =1 ; + dev->vblank_disable_allowed = true; dev->max_vblank_count =0xffffff ;/* only 24 bits of frame count */
drivers/gpu/drm/i915/i915_dma.c +1 -1
@@ -1333,7 +1333,7 @@ static int i915_load_modeset_init(struct drm_device *dev)/* Always safe in the mode setting case. */ /* FIXME: do pre/post-mode set stuff in core KMS code */ - dev->vblank_disable_allowed =1 ; + dev->vblank_disable_allowed = true;if (INTEL_INFO (dev)->num_pipes ==0 ) {intel_display_power_put (dev,POWER_DOMAIN_VGA );return 0 ;
drivers/staging/imx-drm/imx-drm-core.c +2 -2
@@ -423,11 +423,11 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) goto err_init;/* -* with vblank_disable_allowed = 1, vblank interrupt will be disabled +* with vblank_disable_allowed = true, vblank interrupt will be disabled * by drm timer once a current process gives up ownership of * vblank event.(after drm_vblank_put function is called) */ - imxdrm->drm->vblank_disable_allowed =1 ; + imxdrm->drm->vblank_disable_allowed = true;if (!imx_drm_device_get ()) ret = -EINVAL ;
include/drm/drmP.h +1 -1
@@ -1157,7 +1157,7 @@ struct drm_device {* Once the modeset ioctl *has* been called though, we can safely * disable them when unused. */ -int vblank_disable_allowed; +bool vblank_disable_allowed;wait_queue_head_t *vbl_queue;/**< VBLANK wait queue */ atomic_t *_vblank_count;/**< number of VBLANK interrupts (driver must alloc the right number of counters) */
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/10 drm: Make vblank_inmodeset unsigned
In reply to [email protected]From: Ville Syrjälä <[email protected]>
vblank_inmodeset is a bitmask, with only two bits mind you, but better make it unsigned anyway.
--- include/drm/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/drmP.h +1 -1
@@ -1169,7 +1169,7 @@ struct drm_device {/* for wraparound handling */ int *vblank_enabled;/* so we don't call enable more than once per disable */ -int *vblank_inmodeset;/* Display driver is setting mode */ +unsigned int *vblank_inmodeset;/* Display driver is setting mode */ u32 *last_vblank_wait;/* Last vblank seqno waited per CRTC */ struct timer_list vblank_disable_timer;
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/10 drm: Make vblank_enabled bool
In reply to [email protected]From: Ville Syrjälä <[email protected]>
vblank_enabled is only ever 0 or 1, so make it a bool.
--- drivers/gpu/drm/drm_irq.c | 8 ++++---- drivers/gpu/drm/omapdrm/omap_irq.c | 2 +- include/drm/drmP.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_irq.c +4 -4
@@ -115,7 +115,7 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc)spin_lock_irqsave (&dev->vblank_time_lock, irqflags); dev->driver->disable_vblank (dev, crtc); - dev->vblank_enabled[crtc] =0 ; + dev->vblank_enabled[crtc] = false;/* No further vblank irq's will be processed after * this point. Get current hardware vblank count and
@@ -235,7 +235,7 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)if (!dev->vblank_refcount) goto err; - dev->vblank_enabled =kcalloc (num_crtcs,sizeof (int ),GFP_KERNEL ); + dev->vblank_enabled =kcalloc (num_crtcs,sizeof (bool ),GFP_KERNEL );if (!dev->vblank_enabled) goto err;
@@ -412,7 +412,7 @@ int drm_irq_uninstall(struct drm_device *dev)spin_lock_irqsave (&dev->vbl_lock, irqflags);for (i =0 ; i < dev->num_crtcs; i++) {DRM_WAKEUP (&dev->vbl_queue[i]); - dev->vblank_enabled[i] =0 ; + dev->vblank_enabled[i] = false; dev->last_vblank[i] = dev->driver->get_vblank_counter (dev, i); }
@@ -973,7 +973,7 @@ int drm_vblank_get(struct drm_device *dev, int crtc)if (ret)atomic_dec (&dev->vblank_refcount[crtc]);else { - dev->vblank_enabled[crtc] =1 ; + dev->vblank_enabled[crtc] = true;drm_update_vblank_count (dev, crtc); } }
drivers/gpu/drm/omapdrm/omap_irq.c +1 -1
@@ -308,7 +308,7 @@ int omap_drm_irq_uninstall(struct drm_device *dev)spin_lock_irqsave (&dev->vbl_lock, irqflags);for (i =0 ; i < dev->num_crtcs; i++) {DRM_WAKEUP (&dev->vbl_queue[i]); - dev->vblank_enabled[i] =0 ; + dev->vblank_enabled[i] = false; dev->last_vblank[i] = dev->driver->get_vblank_counter (dev, i); }
include/drm/drmP.h +1 -1
@@ -1167,7 +1167,7 @@ struct drm_device {atomic_t *vblank_refcount;/* number of users of vblank interruptsper crtc */ u32 *last_vblank;/* protected by dev->vbl_lock, used */ /* for wraparound handling */ -int *vblank_enabled;/* so we don't call enable more than +bool *vblank_enabled;/* so we don't call enable more than once per disable */ unsigned int *vblank_inmodeset;/* Display driver is setting mode */ u32 *last_vblank_wait;/* Last vblank seqno waited per CRTC */
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/10 drm: Collect per-crtc vblank stuff to a struct
In reply to [email protected]From: Ville Syrjälä <[email protected]>
drm_vblank_init() is too ugly. Make it a bit easier on the eye by collecting all the per-crtc vblank counters, timestamps etc. to a structure and just allocate an array of those.
--- drivers/gpu/drm/drm_info.c | 6 +- drivers/gpu/drm/drm_irq.c | 138 +++++++++++++------------------------ drivers/gpu/drm/gma500/psb_irq.c | 22 +++--- drivers/gpu/drm/i915/intel_pm.c | 2 +- drivers/gpu/drm/omapdrm/omap_irq.c | 6 +- include/drm/drmP.h | 26 ++++--- 6 files changed, 81 insertions(+), 119 deletions(-)
drivers/gpu/drm/drm_info.c +3 -3
@@ -163,13 +163,13 @@ int drm_vblank_info(struct seq_file *m, void *data)mutex_lock (&dev->struct_mutex);for (crtc =0 ; crtc < dev->num_crtcs; crtc++) {seq_printf (m,"CRTC %d enable: %d\n" , - crtc,atomic_read (&dev->vblank_refcount[crtc])); + crtc,atomic_read (&dev->vblank[crtc].refcount));seq_printf (m,"CRTC %d counter: %d\n" , crtc,drm_vblank_count (dev, crtc));seq_printf (m,"CRTC %d last wait: %d\n" , - crtc, dev->last_vblank_wait[crtc]); + crtc, dev->vblank[crtc].last_wait);seq_printf (m,"CRTC %d in modeset: %d\n" , - crtc, dev->vblank_inmodeset[crtc]); + crtc, dev->vblank[crtc].inmodeset); }mutex_unlock (&dev->struct_mutex);return 0 ;
drivers/gpu/drm/drm_irq.c +47 -91
322 lines not on this page · raw message
drivers/gpu/drm/gma500/psb_irq.c +11 -11
@@ -271,15 +271,15 @@ void psb_irq_preinstall(struct drm_device *dev)if (gma_power_is_on (dev))PSB_WVDC32 (0xFFFFFFFF ,PSB_HWSTAM ); -if (dev->vblank_enabled[0 ]) +if (dev->vblank[0 ].enabled) dev_priv->vdc_irq_mask |= _PSB_VSYNC_PIPEA_FLAG; -if (dev->vblank_enabled[1 ]) +if (dev->vblank[1 ].enabled) dev_priv->vdc_irq_mask |= _PSB_VSYNC_PIPEB_FLAG;/* FIXME: Handle Medfield irq mask -if (dev->vblank_enabled[1]) +if (dev->vblank[1].enabled) dev_priv->vdc_irq_mask |= _MDFLD_PIPEB_EVENT_FLAG; -if (dev->vblank_enabled[2]) +if (dev->vblank[2].enabled) dev_priv->vdc_irq_mask |= _MDFLD_PIPEC_EVENT_FLAG; */
@@ -305,17 +305,17 @@ int psb_irq_postinstall(struct drm_device *dev)PSB_WVDC32 (dev_priv->vdc_irq_mask,PSB_INT_ENABLE_R );PSB_WVDC32 (0xFFFFFFFF ,PSB_HWSTAM ); -if (dev->vblank_enabled[0 ]) +if (dev->vblank[0 ].enabled)psb_enable_pipestat (dev_priv,0 ,PIPE_VBLANK_INTERRUPT_ENABLE );else psb_disable_pipestat (dev_priv,0 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -if (dev->vblank_enabled[1 ]) +if (dev->vblank[1 ].enabled)psb_enable_pipestat (dev_priv,1 ,PIPE_VBLANK_INTERRUPT_ENABLE );else psb_disable_pipestat (dev_priv,1 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -if (dev->vblank_enabled[2 ]) +if (dev->vblank[2 ].enabled)psb_enable_pipestat (dev_priv,2 ,PIPE_VBLANK_INTERRUPT_ENABLE );else psb_disable_pipestat (dev_priv,2 ,PIPE_VBLANK_INTERRUPT_ENABLE );
@@ -339,13 +339,13 @@ void psb_irq_uninstall(struct drm_device *dev)PSB_WVDC32 (0xFFFFFFFF ,PSB_HWSTAM ); -if (dev->vblank_enabled[0 ]) +if (dev->vblank[0 ].enabled)psb_disable_pipestat (dev_priv,0 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -if (dev->vblank_enabled[1 ]) +if (dev->vblank[1 ].enabled)psb_disable_pipestat (dev_priv,1 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -if (dev->vblank_enabled[2 ]) +if (dev->vblank[2 ].enabled)psb_disable_pipestat (dev_priv,2 ,PIPE_VBLANK_INTERRUPT_ENABLE ); dev_priv->vdc_irq_mask &= _PSB_IRQ_SGX_FLAG |
@@ -456,7 +456,7 @@ static int psb_vblank_do_wait(struct drm_device *dev, {unsigned int cur_vblank;int ret =0 ; -DRM_WAIT_ON (ret, dev->vbl_queue,3 *DRM_HZ , +DRM_WAIT_ON (ret, dev->vblank.queue,3 *DRM_HZ , (((cur_vblank =atomic_read (counter)) - *sequence) <= (1 <<23 ))); *sequence = cur_vblank;
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -5428,7 +5428,7 @@ static void __intel_set_power_well(struct drm_device *dev, bool enable)spin_lock_irqsave (&dev->vbl_lock, irqflags);for_each_pipe (p)if (p !=PIPE_A ) - dev->last_vblank[p] =0 ; + dev->vblank[p].last =0 ;spin_unlock_irqrestore (&dev->vbl_lock, irqflags); } }
drivers/gpu/drm/omapdrm/omap_irq.c +3 -3
@@ -307,9 +307,9 @@ int omap_drm_irq_uninstall(struct drm_device *dev)if (dev->num_crtcs) {spin_lock_irqsave (&dev->vbl_lock, irqflags);for (i =0 ; i < dev->num_crtcs; i++) { -DRM_WAKEUP (&dev->vbl_queue[i]); - dev->vblank_enabled[i] = false; - dev->last_vblank[i] = +DRM_WAKEUP (&dev->vblank[i].queue); + dev->vblank[i].enabled = false; + dev->vblank[i].last = dev->driver->get_vblank_counter (dev, i); }spin_unlock_irqrestore (&dev->vbl_lock, irqflags);
include/drm/drmP.h +16 -10
@@ -1084,6 +1084,19 @@ struct drm_pending_vblank_event {struct drm_event_vblank event; }; +struct drm_vblank_crtc { +wait_queue_head_t queue;/**< VBLANK wait queue */ +struct timeval time[DRM_VBLANKTIME_RBSIZE ];/**< timestamp of current count */ +atomic_t count;/**< number of VBLANK interrupts */ +atomic_t refcount;/* number of users of vblank interruptsper crtc */ +u32 last;/* protected by dev->vbl_lock, used */ +/* for wraparound handling */ +u32 last_wait;/* Last vblank seqno waited per CRTC */ +unsigned int inmodeset;/* Display driver is setting mode */ +bool enabled;/* so we don't call enable more than +once per disable */ +}; +/** * DRM device structure. This structure represent a complete card that * may contain multiple heads.
@@ -1159,18 +1172,11 @@ struct drm_device {*/ bool vblank_disable_allowed; -wait_queue_head_t *vbl_queue;/**< VBLANK wait queue */ -atomic_t *_vblank_count;/**< number of VBLANK interrupts (driver must alloc the right number of counters) */ -struct timeval *_vblank_time;/**< timestamp of current vblank_count (drivers must alloc right number of fields) */ +/* array of size num_crtcs */ +struct drm_vblank_crtc *vblank; +spinlock_t vblank_time_lock;/**< Protects vblank count and time updates during vblank enable/disable */ spinlock_t vbl_lock; -atomic_t *vblank_refcount;/* number of users of vblank interruptsper crtc */ -u32 *last_vblank;/* protected by dev->vbl_lock, used */ -/* for wraparound handling */ -bool *vblank_enabled;/* so we don't call enable more than -once per disable */ -unsigned int *vblank_inmodeset;/* Display driver is setting mode */ -u32 *last_vblank_wait;/* Last vblank seqno waited per CRTC */ struct timer_list vblank_disable_timer;u32 max_vblank_count;/**< size of vblank counter register */
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/10 drm: Make irq_enabled bool
In reply to [email protected]From: Ville Syrjälä <[email protected]>
irq_enabled is only ever 0 or 1, so make it a bool.
--- drivers/gpu/drm/drm_irq.c | 11 ++++++----- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++-- drivers/gpu/drm/mga/mga_irq.c | 2 +- drivers/gpu/drm/omapdrm/omap_irq.c | 11 ++++++----- drivers/gpu/host1x/drm/drm.c | 2 +- drivers/staging/imx-drm/imx-drm-core.c | 4 ++-- include/drm/drmP.h | 2 +- 8 files changed, 21 insertions(+), 19 deletions(-)
drivers/gpu/drm/drm_irq.c +6 -5
@@ -293,7 +293,7 @@ int drm_irq_install(struct drm_device *dev)mutex_unlock (&dev->struct_mutex);return -EBUSY ; } - dev->irq_enabled =1 ; + dev->irq_enabled = true;mutex_unlock (&dev->struct_mutex);DRM_DEBUG ("irq=%d\n" ,drm_dev_to_irq (dev));
@@ -316,7 +316,7 @@ int drm_irq_install(struct drm_device *dev)if (ret <0 ) {mutex_lock (&dev->struct_mutex); - dev->irq_enabled =0 ; + dev->irq_enabled = false;mutex_unlock (&dev->struct_mutex);return ret; }
@@ -330,7 +330,7 @@ int drm_irq_install(struct drm_device *dev)if (ret <0 ) {mutex_lock (&dev->struct_mutex); - dev->irq_enabled =0 ; + dev->irq_enabled = false;mutex_unlock (&dev->struct_mutex);if (!drm_core_check_feature (dev,DRIVER_MODESET ))vga_client_register (dev->pdev,NULL ,NULL ,NULL );
@@ -351,14 +351,15 @@ EXPORT_SYMBOL(drm_irq_install);int drm_irq_uninstall (struct drm_device *dev) {unsigned long irqflags; -int irq_enabled, i; +bool irq_enabled; +int i;if (!drm_core_check_feature (dev,DRIVER_HAVE_IRQ ))return -EINVAL ;mutex_lock (&dev->struct_mutex); irq_enabled = dev->irq_enabled; - dev->irq_enabled =0 ; + dev->irq_enabled = false;mutex_unlock (&dev->struct_mutex);/*
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -2
@@ -716,13 +716,13 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev) {/* * enable drm irq mode. -* - with irq_enabled = 1, we can use the vblank feature. +* - with irq_enabled = true, we can use the vblank feature. * * P.S. note that we wouldn't use drm irq handler but * just specific driver own one instead because * drm framework supports only one irq handler. */ - drm_dev->irq_enabled =1 ; + drm_dev->irq_enabled = true;/* * with vblank_disable_allowed = true, vblank interrupt will be disabled
drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 -2
@@ -385,13 +385,13 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) {/* * enable drm irq mode. -* - with irq_enabled = 1, we can use the vblank feature. +* - with irq_enabled = true, we can use the vblank feature. * * P.S. note that we wouldn't use drm irq handler but * just specific driver own one instead because * drm framework supports only one irq handler. */ - drm_dev->irq_enabled =1 ; + drm_dev->irq_enabled = true;/* * with vblank_disable_allowed = true, vblank interrupt will be disabled
drivers/gpu/drm/mga/mga_irq.c +1 -1
@@ -169,5 +169,5 @@ void mga_driver_irq_uninstall(struct drm_device *dev)/* Disable *all* interrupts */ MGA_WRITE (MGA_IEN ,0 ); - dev->irq_enabled =0 ; + dev->irq_enabled = false; }
drivers/gpu/drm/omapdrm/omap_irq.c +6 -5
@@ -261,7 +261,7 @@ int omap_drm_irq_install(struct drm_device *dev)mutex_unlock (&dev->struct_mutex);return -EBUSY ; } - dev->irq_enabled =1 ; + dev->irq_enabled = true;mutex_unlock (&dev->struct_mutex);/* Before installing handler */
@@ -272,7 +272,7 @@ int omap_drm_irq_install(struct drm_device *dev)if (ret <0 ) {mutex_lock (&dev->struct_mutex); - dev->irq_enabled =0 ; + dev->irq_enabled = false;mutex_unlock (&dev->struct_mutex);return ret; }
@@ -283,7 +283,7 @@ int omap_drm_irq_install(struct drm_device *dev)if (ret <0 ) {mutex_lock (&dev->struct_mutex); - dev->irq_enabled =0 ; + dev->irq_enabled = false;mutex_unlock (&dev->struct_mutex);dispc_free_irq (dev); }
@@ -294,11 +294,12 @@ int omap_drm_irq_install(struct drm_device *dev)int omap_drm_irq_uninstall (struct drm_device *dev) {unsigned long irqflags; -int irq_enabled, i; +bool irq_enabled; +int i;mutex_lock (&dev->struct_mutex); irq_enabled = dev->irq_enabled; - dev->irq_enabled =0 ; + dev->irq_enabled = false;mutex_unlock (&dev->struct_mutex);/*
drivers/gpu/host1x/drm/drm.c +1 -1
@@ -264,7 +264,7 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)* core, so we need to set this manually in order to allow the * DRM_IOCTL_WAIT_VBLANK to operate correctly. */ - drm->irq_enabled =1 ; + drm->irq_enabled = true; err =drm_vblank_init (drm, drm->mode_config.num_crtc);if (err <0 )
drivers/staging/imx-drm/imx-drm-core.c +2 -2
@@ -396,14 +396,14 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)/* * enable drm irq mode. -* - with irq_enabled = 1, we can use the vblank feature. +* - with irq_enabled = true, we can use the vblank feature. * * P.S. note that we wouldn't use drm irq handler but * just specific driver own one instead because * drm framework supports only one irq handler and * drivers can well take care of their interrupts */ - drm->irq_enabled =1 ; + drm->irq_enabled = true;drm_mode_config_init (drm);imx_drm_mode_config_init (drm);
include/drm/drmP.h +1 -1
@@ -1155,7 +1155,7 @@ struct drm_device {/** \name Context support */ /*@{ */ -int irq_enabled;/**< True if irq handler is enabled */ +bool irq_enabled;/**< True if irq handler is enabled */ __volatile__ long context_flag;/**< Context swapping flag */ int last_context;/**< Last current context */ /*@} */
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/10 drm: Kill unused stuff from struct drm_device
In reply to [email protected]From: Ville Syrjälä <[email protected]>
'map_count' and 'work' are never used. Kill them both.
--- include/drm/drmP.h | 2 -- 1 file changed, 2 deletions(-)
include/drm/drmP.h +0 -2
@@ -1133,7 +1133,6 @@ struct drm_device {/** \name Memory management */ /*@{ */ struct list_head maplist;/**< Linked list of regions */ -int map_count;/**< Number of mappable regions */ struct drm_open_hash map_hash;/**< User token hash table for maps */ /** \name Context handle management */
@@ -1160,7 +1159,6 @@ struct drm_device {int last_context;/**< Last current context */ /*@} */ -struct work_struct work;/** \name VBLANK IRQ support */ /*@{ */
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/10 drm: Kill ctx_count from struct drm_device
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The only user of ctx_count is the via driver, and we can replace that use with list_is_singular().
--- drivers/gpu/drm/drm_context.c | 2 -- drivers/gpu/drm/drm_fops.c | 1 - drivers/gpu/drm/via/via_mm.c | 2 +- include/drm/drmP.h | 1 - 4 files changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/drm_context.c +0 -2
@@ -334,7 +334,6 @@ int drm_addctx(struct drm_device *dev, void *data,mutex_lock (&dev->ctxlist_mutex);list_add (&ctx_entry->head, &dev->ctxlist); - ++dev->ctx_count;mutex_unlock (&dev->ctxlist_mutex);return 0 ;
@@ -432,7 +431,6 @@ int drm_rmctx(struct drm_device *dev, void *data,if (pos->handle == ctx->handle) {list_del (&pos->head);kfree (pos); - --dev->ctx_count; } } }
drivers/gpu/drm/drm_fops.c +0 -1
@@ -454,7 +454,6 @@ int drm_release(struct inode *inode, struct file *filp)list_del (&pos->head);kfree (pos); - --dev->ctx_count; } } }
drivers/gpu/drm/via/via_mm.c +1 -1
@@ -79,7 +79,7 @@ int via_final_context(struct drm_device *dev, int context)/* Linux specific until context tracking code gets ported to BSD */ /* Last context, perform cleanup */ -if (dev->ctx_count ==1 && dev->dev_private) { +if (list_is_singular (&dev->ctxlist) && dev->dev_private) {DRM_DEBUG ("Last Context\n" );drm_irq_uninstall (dev);via_cleanup_futex (dev_priv);
include/drm/drmP.h +0 -1
@@ -1138,7 +1138,6 @@ struct drm_device {/** \name Context handle management */ /*@{ */ struct list_head ctxlist;/**< Linked list of context handles */ -int ctx_count;/**< Number of context handles */ struct mutex ctxlist_mutex;/**< For ctxlist */ struct idr ctx_idr;
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/10 drm: Remove pci_vendor and pci_device from struct drm_device
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We can get the PCI vendor and device IDs via dev->pdev. So we can drop the duplicated information.
--- drivers/gpu/drm/drm_pci.c | 3 --- drivers/gpu/drm/gma500/psb_drv.h | 8 +++---- drivers/gpu/drm/i915/i915_dma.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 36 ++++++++++++++--------------- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm/i915/intel_tv.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/arb.c | 8 +++---- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 4 ++-- drivers/gpu/drm/nouveau/dispnv04/disp.h | 6 ++--- drivers/gpu/drm/nouveau/dispnv04/hw.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_abi16.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_bios.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 ++-- drivers/gpu/drm/radeon/radeon_bios.c | 6 ++--- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- include/drm/drmP.h | 2 -- 16 files changed, 46 insertions(+), 51 deletions(-)
drivers/gpu/drm/drm_pci.c +0 -3
@@ -333,9 +333,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, dev->pdev = pdev; dev->dev = &pdev->dev; - dev->pci_device = pdev->device; - dev->pci_vendor = pdev->vendor; -#ifdef __alpha__ dev->hose = pdev->sysdata;#endif
drivers/gpu/drm/gma500/psb_drv.h +4 -4
@@ -44,10 +44,10 @@ enum { CHIP_MFLD_0130 = 3, /* Medfield */ }; -#define IS_PSB (dev) (((dev)->pci_device & 0xfffe) == 0x8108) -#define IS_MRST (dev) (((dev)->pci_device & 0xfffc) == 0x4100) -#define IS_MFLD (dev) (((dev)->pci_device & 0xfff8) == 0x0130) -#define IS_CDV (dev) (((dev)->pci_device & 0xfff0) == 0x0be0) +#define IS_PSB (dev) (((dev)->pdev->device & 0xfffe) == 0x8108) +#define IS_MRST (dev) (((dev)->pdev->device & 0xfffc) == 0x4100) +#define IS_MFLD (dev) (((dev)->pdev->device & 0xfff8) == 0x0130) +#define IS_CDV (dev) (((dev)->pdev->device & 0xfff0) == 0x0be0)/* * Driver definitions
drivers/gpu/drm/i915/i915_dma.c +1 -1
@@ -931,7 +931,7 @@ static int i915_getparam(struct drm_device *dev, void *data, value =READ_BREADCRUMB (dev_priv);break ;case I915_PARAM_CHIPSET_ID : - value = dev->pci_device; + value = dev->pdev->device;break ;case I915_PARAM_HAS_GEM : value =1 ;
drivers/gpu/drm/i915/i915_drv.h +18 -18
@@ -1615,39 +1615,39 @@ struct drm_i915_file_private {#define INTEL_INFO (dev) (to_i915(dev)->info) -#define IS_I830 (dev) ((dev)->pci_device == 0x3577) -#define IS_845G (dev) ((dev)->pci_device == 0x2562) +#define IS_I830 (dev) ((dev)->pdev->device == 0x3577) +#define IS_845G (dev) ((dev)->pdev->device == 0x2562)#define IS_I85X (dev) (INTEL_INFO(dev)->is_i85x) -#define IS_I865G (dev) ((dev)->pci_device == 0x2572) +#define IS_I865G (dev) ((dev)->pdev->device == 0x2572)#define IS_I915G (dev) (INTEL_INFO(dev)->is_i915g) -#define IS_I915GM (dev) ((dev)->pci_device == 0x2592) -#define IS_I945G (dev) ((dev)->pci_device == 0x2772) +#define IS_I915GM (dev) ((dev)->pdev->device == 0x2592) +#define IS_I945G (dev) ((dev)->pdev->device == 0x2772)#define IS_I945GM (dev) (INTEL_INFO(dev)->is_i945gm)#define IS_BROADWATER (dev) (INTEL_INFO(dev)->is_broadwater)#define IS_CRESTLINE (dev) (INTEL_INFO(dev)->is_crestline) -#define IS_GM45 (dev) ((dev)->pci_device == 0x2A42) +#define IS_GM45 (dev) ((dev)->pdev->device == 0x2A42)#define IS_G4X (dev) (INTEL_INFO(dev)->is_g4x) -#define IS_PINEVIEW_G (dev) ((dev)->pci_device == 0xa001) -#define IS_PINEVIEW_M (dev) ((dev)->pci_device == 0xa011) +#define IS_PINEVIEW_G (dev) ((dev)->pdev->device == 0xa001) +#define IS_PINEVIEW_M (dev) ((dev)->pdev->device == 0xa011)#define IS_PINEVIEW (dev) (INTEL_INFO(dev)->is_pineview)#define IS_G33 (dev) (INTEL_INFO(dev)->is_g33) -#define IS_IRONLAKE_M (dev) ((dev)->pci_device == 0x0046) +#define IS_IRONLAKE_M (dev) ((dev)->pdev->device == 0x0046)#define IS_IVYBRIDGE (dev) (INTEL_INFO(dev)->is_ivybridge) -#define IS_IVB_GT1 (dev) ((dev)->pci_device == 0x0156 || \ - (dev)->pci_device == 0x0152 || \ - (dev)->pci_device == 0x015a) -#define IS_SNB_GT1 (dev) ((dev)->pci_device == 0x0102 || \ - (dev)->pci_device == 0x0106 || \ - (dev)->pci_device == 0x010A) +#define IS_IVB_GT1 (dev) ((dev)->pdev->device == 0x0156 || \ + (dev)->pdev->device == 0x0152 || \ + (dev)->pdev->device == 0x015a) +#define IS_SNB_GT1 (dev) ((dev)->pdev->device == 0x0102 || \ + (dev)->pdev->device == 0x0106 || \ + (dev)->pdev->device == 0x010A)#define IS_VALLEYVIEW (dev) (INTEL_INFO(dev)->is_valleyview)#define IS_HASWELL (dev) (INTEL_INFO(dev)->is_haswell)#define IS_MOBILE (dev) (INTEL_INFO(dev)->is_mobile)#define IS_HSW_EARLY_SDV (dev) (IS_HASWELL(dev) && \ - ((dev)->pci_device & 0xFF00) == 0x0C00) + ((dev)->pdev->device & 0xFF00) == 0x0C00)#define IS_ULT (dev) (IS_HASWELL(dev) && \ - ((dev)->pci_device & 0xFF00) == 0x0A00) + ((dev)->pdev->device & 0xFF00) == 0x0A00)#define IS_HSW_GT3 (dev) (IS_HASWELL(dev) && \ - ((dev)->pci_device & 0x00F0) == 0x0020) + ((dev)->pdev->device & 0x00F0) == 0x0020)#define IS_PRELIMINARY_HW (intel_info) ((intel_info)->is_preliminary)/*
drivers/gpu/drm/i915/i915_gpu_error.c +1 -1
@@ -304,7 +304,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,err_printf (m,"Time: %ld s %ld us\n" , error->time.tv_sec, error->time.tv_usec);err_printf (m,"Kernel: " UTS_RELEASE "\n" ); -err_printf (m,"PCI ID: 0x%04x\n" , dev->pci_device); +err_printf (m,"PCI ID: 0x%04x\n" , dev->pdev->device);err_printf (m,"EIR: 0x%08x\n" , error->eir);err_printf (m,"IER: 0x%08x\n" , error->ier);err_printf (m,"PGTBL_ER: 0x%08x\n" , error->pgtbl_er);
drivers/gpu/drm/i915/intel_tv.c +1 -1
@@ -1044,7 +1044,7 @@ static void intel_tv_mode_set(struct intel_encoder *encoder) tv_mode->dda3_inc <<TV_SCDDA3_INC_SHIFT ;/* Enable two fixes for the chips that need them. */ -if (dev->pci_device <0x2772 ) +if (dev->pdev->device <0x2772 ) tv_ctl |=TV_ENC_C0_FIX |TV_ENC_SDP_FIX ;I915_WRITE (TV_H_CTL_1 , hctl1);
drivers/gpu/drm/nouveau/dispnv04/arb.c +4 -4
@@ -210,8 +210,8 @@ nv04_update_arb(struct drm_device *dev, int VClk, int bpp, sim_data.nvclk_khz = NVClk; sim_data.bpp = bpp; sim_data.two_heads =nv_two_heads (dev); -if ((dev->pci_device &0xffff ) ==0x01a0 /*CHIPSET_NFORCE*/ || - (dev->pci_device &0xffff ) ==0x01f0 /*CHIPSET_NFORCE2*/ ) { +if ((dev->pdev->device &0xffff ) ==0x01a0 /*CHIPSET_NFORCE*/ || + (dev->pdev->device &0xffff ) ==0x01f0 /*CHIPSET_NFORCE2*/ ) {uint32_t type;pci_read_config_dword (pci_get_bus_and_slot (0 ,1 ),0x7c , &type);
@@ -256,8 +256,8 @@ nouveau_calc_arb(struct drm_device *dev, int vclk, int bpp, int *burst, int *lwmif (nv_device (drm->device)->card_type <NV_20 )nv04_update_arb (dev, vclk, bpp, burst, lwm); -else if ((dev->pci_device &0xfff0 ) ==0x0240 /*CHIPSET_C51*/ || - (dev->pci_device &0xfff0 ) ==0x03d0 /*CHIPSET_C512*/ ) { +else if ((dev->pdev->device &0xfff0 ) ==0x0240 /*CHIPSET_C51*/ || + (dev->pdev->device &0xfff0 ) ==0x03d0 /*CHIPSET_C512*/ ) { *burst =128 ; *lwm =0x0480 ; }else
drivers/gpu/drm/nouveau/dispnv04/dfp.c +2 -2
@@ -490,8 +490,8 @@ static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode)/* BIOS scripts usually take care of the backlight, thanks * Apple for your consistency. */ -if (dev->pci_device ==0x0174 || dev->pci_device ==0x0179 || - dev->pci_device ==0x0189 || dev->pci_device ==0x0329 ) { +if (dev->pdev->device ==0x0174 || dev->pdev->device ==0x0179 || + dev->pdev->device ==0x0189 || dev->pdev->device ==0x0329 ) {if (mode ==DRM_MODE_DPMS_ON ) {nv_mask (device,NV_PBUS_DEBUG_DUALHEAD_CTL ,0 ,1 <<31 );nv_mask (device,NV_PCRTC_GPIO_EXT ,3 ,1 );
drivers/gpu/drm/nouveau/dispnv04/disp.h +3 -3
@@ -127,7 +127,7 @@ static inline bool nv_two_heads(struct drm_device *dev) {struct nouveau_drm *drm =nouveau_drm (dev); -const int impl = dev->pci_device &0x0ff0 ; +const int impl = dev->pdev->device &0x0ff0 ;if (nv_device (drm->device)->card_type >=NV_10 && impl !=0x0100 && impl !=0x0150 && impl !=0x01a0 && impl !=0x0200 )
@@ -139,14 +139,14 @@ nv_two_heads(struct drm_device *dev)static inline bool nv_gf4_disp_arch (struct drm_device *dev) { -return nv_two_heads (dev) && (dev->pci_device &0x0ff0 ) !=0x0110 ; +return nv_two_heads (dev) && (dev->pdev->device &0x0ff0 ) !=0x0110 ; }static inline bool nv_two_reg_pll (struct drm_device *dev) {struct nouveau_drm *drm =nouveau_drm (dev); -const int impl = dev->pci_device &0x0ff0 ; +const int impl = dev->pdev->device &0x0ff0 ;if (impl ==0x0310 || impl ==0x0340 ||nv_device (drm->device)->card_type >=NV_40 )return true;
drivers/gpu/drm/nouveau/dispnv04/hw.c +2 -2
@@ -220,7 +220,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)int ret;if (plltype ==PLL_MEMORY && - (dev->pci_device &0x0ff0 ) ==CHIPSET_NFORCE ) { + (dev->pdev->device &0x0ff0 ) ==CHIPSET_NFORCE ) {uint32_t mpllP;pci_read_config_dword (pci_get_bus_and_slot (0 ,3 ),0x6c , &mpllP);
@@ -230,7 +230,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)return 400000 / mpllP; }else if (plltype ==PLL_MEMORY && - (dev->pci_device &0xff0 ) ==CHIPSET_NFORCE2 ) { + (dev->pdev->device &0xff0 ) ==CHIPSET_NFORCE2 ) {uint32_t clock;pci_read_config_dword (pci_get_bus_and_slot (0 ,5 ),0x4c , &clock);
drivers/gpu/drm/nouveau/nouveau_abi16.c +2 -2
@@ -178,10 +178,10 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS) getparam->value = device->chipset;break ;case NOUVEAU_GETPARAM_PCI_VENDOR : - getparam->value = dev->pci_vendor; + getparam->value = dev->pdev->vendor;break ;case NOUVEAU_GETPARAM_PCI_DEVICE : - getparam->value = dev->pci_device; + getparam->value = dev->pdev->device;break ;case NOUVEAU_GETPARAM_BUS_TYPE :if (drm_pci_device_is_agp (dev))
drivers/gpu/drm/nouveau/nouveau_bios.c +2 -2
@@ -127,8 +127,8 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_outp#ifdef __powerpc__/* Powerbook specific quirks */ if (script ==LVDS_RESET && - (dev->pci_device ==0x0179 || dev->pci_device ==0x0189 || - dev->pci_device ==0x0329 )) + (dev->pdev->device ==0x0179 || dev->pdev->device ==0x0189 || + dev->pdev->device ==0x0329 ))nv_write_tmds (dev, dcbent->or,0 ,0x02 ,0x72 );#endif
drivers/gpu/drm/nouveau/nouveau_connector.c +2 -2
@@ -215,8 +215,8 @@ nouveau_connector_set_encoder(struct drm_connector *connector, connector->doublescan_allowed = true;if (nv_device (drm->device)->card_type ==NV_20 || (nv_device (drm->device)->card_type ==NV_10 && - (dev->pci_device &0x0ff0 ) !=0x0100 && - (dev->pci_device &0x0ff0 ) !=0x0150 )) + (dev->pdev->device &0x0ff0 ) !=0x0100 && + (dev->pdev->device &0x0ff0 ) !=0x0150 ))/* HW is broken */ connector->interlace_allowed = false;else
drivers/gpu/drm/radeon/radeon_bios.c +3 -3
@@ -499,7 +499,7 @@ static bool legacy_read_disabled_bios(struct radeon_device *rdev) crtc_ext_cntl =RREG32 (RADEON_CRTC_EXT_CNTL ); fp2_gen_cntl =0 ; -if (rdev->ddev->pci_device ==PCI_DEVICE_ID_ATI_RADEON_QY ) { +if (rdev->ddev->pdev->device ==PCI_DEVICE_ID_ATI_RADEON_QY ) { fp2_gen_cntl =RREG32 (RADEON_FP2_GEN_CNTL ); }
@@ -536,7 +536,7 @@ static bool legacy_read_disabled_bios(struct radeon_device *rdev) (RADEON_CRTC_SYNC_TRISTAT | RADEON_CRTC_DISPLAY_DIS))); -if (rdev->ddev->pci_device ==PCI_DEVICE_ID_ATI_RADEON_QY ) { +if (rdev->ddev->pdev->device ==PCI_DEVICE_ID_ATI_RADEON_QY ) {WREG32 (RADEON_FP2_GEN_CNTL , (fp2_gen_cntl & ~RADEON_FP2_ON )); }
@@ -554,7 +554,7 @@ static bool legacy_read_disabled_bios(struct radeon_device *rdev)WREG32 (RADEON_CRTC2_GEN_CNTL , crtc2_gen_cntl); }WREG32 (RADEON_CRTC_EXT_CNTL , crtc_ext_cntl); -if (rdev->ddev->pci_device ==PCI_DEVICE_ID_ATI_RADEON_QY ) { +if (rdev->ddev->pdev->device ==PCI_DEVICE_ID_ATI_RADEON_QY ) {WREG32 (RADEON_FP2_GEN_CNTL , fp2_gen_cntl); }return r;
drivers/gpu/drm/radeon/radeon_kms.c +1 -1
@@ -191,7 +191,7 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)switch (info->request) {case RADEON_INFO_DEVICE_ID : - *value = dev->pci_device; + *value = dev->pdev->device;break ;case RADEON_INFO_NUM_GB_PIPES : *value = rdev->num_gb_pipes;
include/drm/drmP.h +0 -2
@@ -1190,8 +1190,6 @@ struct drm_device {struct device *dev;/**< Device structure */ struct pci_dev *pdev;/**< PCI device structure */ -int pci_vendor;/**< PCI vendor id */ -int pci_device;/**< PCI device id */ #ifdef __alpha__struct pci_controller *hose;#endif
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/10 drm: Kill drm perf counter leftovers
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The user of these counters was killed in
commit d79cdc8312689b39c6d83718c1c196af4b3cd18c
Author: Daniel Vetter <[email protected]>
Date: Thu Aug 8 15:41:32 2013 +0200
drm: no-op out GET_STATS ioctl
so clean up the leftovers as well.
--- drivers/gpu/drm/drm_drv.c | 6 ------ drivers/gpu/drm/drm_fops.c | 2 -- drivers/gpu/drm/drm_lock.c | 3 --- drivers/gpu/drm/drm_stub.c | 9 --------- drivers/gpu/drm/i810/i810_dma.c | 11 ----------- drivers/gpu/drm/i915/i915_dma.c | 7 ------- drivers/gpu/drm/mga/mga_dma.c | 5 ----- include/drm/drmP.h | 7 ------- 8 files changed, 50 deletions(-)
drivers/gpu/drm/drm_drv.c +0 -6
@@ -178,17 +178,12 @@ static const struct drm_ioctl_desc drm_ioctls[] = {*/ static void drm_legacy_dev_reinit (struct drm_device *dev) { -int i; -if (drm_core_check_feature (dev,DRIVER_MODESET ))return ;atomic_set (&dev->ioctl_count,0 );atomic_set (&dev->vma_count,0 ); -for (i =0 ; i <ARRAY_SIZE (dev->counts); i++) -atomic_set (&dev->counts[i],0 ); - dev->sigdata.lock =NULL ; dev->context_flag =0 ;
@@ -386,7 +381,6 @@ long drm_ioctl(struct file *filp,return -ENODEV ;atomic_inc (&dev->ioctl_count); -atomic_inc (&dev->counts[_DRM_STAT_IOCTLS]); ++file_priv->ioctl_count; if ((nr >= DRM_CORE_IOCTL_COUNT) &&
drivers/gpu/drm/drm_fops.c +0 -2
@@ -113,7 +113,6 @@ int drm_open(struct inode *inode, struct file *filp) retcode =drm_open_helper (inode, filp, dev);if (retcode) goto err_undo; -atomic_inc (&dev->counts[_DRM_STAT_OPENS]);if (need_setup) { retcode =drm_setup (dev);if (retcode)
@@ -515,7 +514,6 @@ int drm_release(struct inode *inode, struct file *filp)* End inline drm_release */ -atomic_inc (&dev->counts[_DRM_STAT_CLOSES]);if (!--dev->open_count) {if (atomic_read (&dev->ioctl_count)) { DRM_ERROR("Device busy: %d\n",
drivers/gpu/drm/drm_lock.c +0 -3
@@ -86,7 +86,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)if (drm_lock_take (&master->lock, lock->context)) { master->lock.file_priv = file_priv; master->lock.lock_time = jiffies; -atomic_inc (&dev->counts[_DRM_STAT_LOCKS]);break ;/* Got lock */ }
@@ -157,8 +156,6 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)return -EINVAL ; } -atomic_inc (&dev->counts[_DRM_STAT_UNLOCKS]); -if (drm_lock_free (&master->lock, lock->context)) {/* FIXME: Should really bail out here. */ }
drivers/gpu/drm/drm_stub.c +0 -9
@@ -275,15 +275,6 @@ int drm_fill_in_dev(struct drm_device *dev,return -ENOMEM ; } -/* the DRM has 6 basic counters */ - dev->counters =6 ; - dev->types[0 ] = _DRM_STAT_LOCK; - dev->types[1 ] = _DRM_STAT_OPENS; - dev->types[2 ] = _DRM_STAT_CLOSES; - dev->types[3 ] = _DRM_STAT_IOCTLS; - dev->types[4 ] = _DRM_STAT_LOCKS; - dev->types[5 ] = _DRM_STAT_UNLOCKS; - dev->driver = driver;if (dev->driver->bus->agp_init) {
drivers/gpu/drm/i810/i810_dma.c +0 -11
@@ -944,8 +944,6 @@ static int i810_dma_vertex(struct drm_device *dev, void *data, dma->buflist[vertex->idx], vertex->discard, vertex->used); -atomic_add (vertex->used, &dev->counts[_DRM_STAT_SECONDARY]); -atomic_inc (&dev->counts[_DRM_STAT_DMA]); sarea_priv->last_enqueue = dev_priv->counter -1 ; sarea_priv->last_dispatch = (int )hw_status[5 ];
@@ -1105,8 +1103,6 @@ static int i810_dma_mc(struct drm_device *dev, void *data,i810_dma_dispatch_mc (dev, dma->buflist[mc->idx], mc->used, mc->last_render); -atomic_add (mc->used, &dev->counts[_DRM_STAT_SECONDARY]); -atomic_inc (&dev->counts[_DRM_STAT_DMA]); sarea_priv->last_enqueue = dev_priv->counter -1 ; sarea_priv->last_dispatch = (int )hw_status[5 ];
@@ -1197,13 +1193,6 @@ static int i810_flip_bufs(struct drm_device *dev, void *data,int i810_driver_load (struct drm_device *dev,unsigned long flags) { -/* i810 has 4 more counters */ - dev->counters +=4 ; - dev->types[6 ] = _DRM_STAT_IRQ; - dev->types[7 ] = _DRM_STAT_PRIMARY; - dev->types[8 ] = _DRM_STAT_SECONDARY; - dev->types[9 ] = _DRM_STAT_DMA; -pci_set_master (dev->pdev);return 0 ;
drivers/gpu/drm/i915/i915_dma.c +0 -7
@@ -1480,13 +1480,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)if (info->gen >=6 && !drm_core_check_feature (dev,DRIVER_MODESET ))return -ENODEV ; -/* i915 has 4 more counters */ - dev->counters +=4 ; - dev->types[6 ] = _DRM_STAT_IRQ; - dev->types[7 ] = _DRM_STAT_PRIMARY; - dev->types[8 ] = _DRM_STAT_SECONDARY; - dev->types[9 ] = _DRM_STAT_DMA; - dev_priv =kzalloc (sizeof (*dev_priv),GFP_KERNEL );if (dev_priv ==NULL )return -ENOMEM ;
drivers/gpu/drm/mga/mga_dma.c +0 -5
@@ -406,11 +406,6 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags) dev_priv->mmio_base =pci_resource_start (dev->pdev,1 ); dev_priv->mmio_size =pci_resource_len (dev->pdev,1 ); - dev->counters +=3 ; - dev->types[6 ] = _DRM_STAT_IRQ; - dev->types[7 ] = _DRM_STAT_PRIMARY; - dev->types[8 ] = _DRM_STAT_SECONDARY; - ret =drm_vblank_init (dev,1 );if (ret) {
include/drm/drmP.h +0 -7
@@ -1121,13 +1121,6 @@ struct drm_device {atomic_t buf_alloc;/**< Buffer allocation in progress */ /*@} */ -/** \name Performance counters */ -/*@{ */ -unsigned long counters; -enum drm_stat_type types[15 ]; -atomic_t counts[15 ]; -/*@} */ -struct list_head filelist;/** \name Memory management */
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/10] drm: Kill drm perf counter leftovers
Quoted 8 lines · On Fri, Oct 04, 2013 at 02:53:41PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The user of these counters was killed in
commit
d79cdc8312689b39c6d83718c1c196af4b3cd18c
Author: Daniel Vetter <[email protected]>
Date: Thu Aug 8 15:41:32 2013 +0200
Quoted 5 lines
drm: no-op out
GET_STATSioctlso clean up the leftovers as well.
Signed-off-by Ville Syrjälä <[email protected]>
This one will conflict with David's driver setup/teardown shuffling a bit. But looks good. I'm not sold on the last patch to pahole struct drm_device, but the others (patches 1-9) are
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
PATCH 10/10 drm: Pack struct drm_device a bit better
In reply to [email protected]From: Ville Syrjälä <[email protected]>
x86-64:
pahole before:
/* size: 1328, cachelines: 21, members: 52 */
/* sum members: 1290, holes: 9, sum holes: 38 */
/* paddings: 3, sum paddings: 11 */
/* last cacheline: 48 bytes */pahole after:
/* size: 1296, cachelines: 21, members: 52 */
/* sum members: 1290, holes: 1, sum holes: 2 */
/* padding: 4 */
/* paddings: 3, sum paddings: 11 */
/* last cacheline: 16 bytes */x86:
pahole before:
/* size: 772, cachelines: 13, members: 52 */
/* sum members: 762, holes: 4, sum holes: 10 */
/* paddings: 3, sum paddings: 7 */
/* last cacheline: 4 bytes */pahole after:
/* size: 764, cachelines: 12, members: 52 */
/* sum members: 762, holes: 1, sum holes: 2 */
/* paddings: 3, sum paddings: 7 */
/* last cacheline: 60 bytes */--- include/drm/drmP.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
include/drm/drmP.h +14 -12
@@ -1121,6 +1121,8 @@ struct drm_device {atomic_t buf_alloc;/**< Buffer allocation in progress */ /*@} */ +unsigned int num_crtcs;/**< Number of CRTCs on this device */ +struct list_head filelist;/** \name Memory management */
@@ -1146,11 +1148,12 @@ struct drm_device {/** \name Context support */ /*@{ */ -bool irq_enabled;/**< True if irq handler is enabled */ __volatile__ long context_flag;/**< Context swapping flag */ int last_context;/**< Last current context */ /*@} */ +bool irq_enabled;/**< True if irq handler is enabled */ +/** \name VBLANK IRQ support */ /*@{ */
@@ -1162,20 +1165,19 @@ struct drm_device {*/ bool vblank_disable_allowed; +/** +* List of events +*/ +spinlock_t event_lock; +struct list_head vblank_event_list; +/* array of size num_crtcs */ struct drm_vblank_crtc *vblank;spinlock_t vblank_time_lock;/**< Protects vblank count and time updates during vblank enable/disable */ spinlock_t vbl_lock; -struct timer_list vblank_disable_timer; -u32 max_vblank_count;/**< size of vblank counter register */ - -/** -* List of events -*/ -struct list_head vblank_event_list; -spinlock_t event_lock; +struct timer_list vblank_disable_timer;/*@} */
@@ -1191,7 +1193,6 @@ struct drm_device {struct usb_device *usbdev;struct drm_sg_mem *sg;/**< Scatter gather memory */ -unsigned int num_crtcs;/**< Number of CRTCs on this device */ void *dev_private;/**< device private data */ void *mm_private;struct address_space *dev_mapping;
@@ -1199,8 +1200,6 @@ struct drm_device {sigset_t sigmask;struct drm_driver *driver; -struct drm_local_map *agp_buffer_map; -unsigned int agp_buffer_token;struct drm_minor *control;/**< Control node for card */ struct drm_minor *primary;/**< render type primary screen head */ struct drm_minor *render;/**< render node for card */
@@ -1215,6 +1214,9 @@ struct drm_device {int switch_power_state;atomic_t unplugged;/* device has been unplugged or gone away */ + +struct drm_local_map *agp_buffer_map; +unsigned int agp_buffer_token; };#define DRM_SWITCH_POWER_ON 0
Signature · 6 lines
1.8.1.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 29 lines · On Fri, Oct 4, 2013 at 7:53 AM, <[email protected]> wrote:
This series does some house cleaning on struct
drm_device.x86-64:
pahole before the series:/* size: 1576, cachelines: 25, members: 67 */ /* sum members: 1528, holes: 12, sum holes: 48 */ /* paddings: 3, sum paddings: 11 */ /* last cacheline: 40 bytes */pahole after the series:
/* size: 1296, cachelines: 21, members: 52 */ /* sum members: 1290, holes: 1, sum holes: 2 */ /* padding: 4 */ /* paddings: 3, sum paddings: 11 */ /* last cacheline: 16 bytes */x86:
pahole before the series:/* size: 956, cachelines: 15, members: 67 */ /* sum members: 952, holes: 2, sum holes: 4 */ /* paddings: 3, sum paddings: 7 */ /* last cacheline: 60 bytes */pahole after the series:
/* size: 764, cachelines: 12, members: 52 */ /* sum members: 762, holes: 1, sum holes: 2 */ /* paddings: 3, sum paddings: 7 */ /* last cacheline: 60 bytes */
Quoted 12 lines
Ville Syrjälä (10):
drm: Makevblank_disable_allowedbool
drm: Makevblank_inmodesetunsigned
drm: Makevblank_enabledbool
drm: Collect per-crtc vblank stuff to a struct
drm: Makeirq_enabledbool
drm: Kill unused stuff from structdrm_device
drm: Killctx_countfrom structdrm_device
drm: Removepci_vendorandpci_devicefrom structdrm_device
drm: Kill drm perf counter leftovers
drm: Pack structdrm_devicea bit better
For the series:
Quoted 40 lines
drivers/gpu/drm/drm_context.c | 2 - drivers/gpu/drm/drm_drv.c | 6 -- drivers/gpu/drm/drm_fops.c | 3 - drivers/gpu/drm/drm_info.c | 6 +- drivers/gpu/drm/drm_irq.c | 152 ++++++++++------------------ drivers/gpu/drm/drm_lock.c | 3 - drivers/gpu/drm/drm_pci.c | 3 - drivers/gpu/drm/drm_stub.c | 9 -- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 +- drivers/gpu/drm/gma500/psb_drv.c | 2 +- drivers/gpu/drm/gma500/psb_drv.h | 8 +- drivers/gpu/drm/gma500/psb_irq.c | 22 ++-- drivers/gpu/drm/i810/i810_dma.c | 11 -- drivers/gpu/drm/i915/i915_dma.c | 11 +- drivers/gpu/drm/i915/i915_drv.h | 36 +++---- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 2 +- drivers/gpu/drm/i915/intel_tv.c | 2 +- drivers/gpu/drm/mga/mga_dma.c | 5 - drivers/gpu/drm/mga/mga_irq.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/arb.c | 8 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/disp.h | 6 +- drivers/gpu/drm/nouveau/dispnv04/hw.c | 4 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 4 +- drivers/gpu/drm/nouveau/nouveau_bios.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +- drivers/gpu/drm/omapdrm/omap_irq.c | 17 ++-- drivers/gpu/drm/radeon/radeon_bios.c | 6 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- drivers/gpu/drm/via/via_mm.c | 2 +- drivers/gpu/host1x/drm/drm.c | 2 +- drivers/staging/imx-drm/imx-drm-core.c | 8 +- include/drm/drmP.h | 62 ++++++------ 35 files changed, 171 insertions(+), 265 deletions(-)_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerQuoted 1 line
Quoted 1 line
This series does some house cleaning on struct
drm_device.
Merged 1-9, not sure the last pahole moving stuff around is a real help or not, will mull it over a bit.
Dave.