dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH 02/12] drm/sis: clean up reclaim_buffers
Date: Sun, 24 Jun 2012 20:09:41 +0200	[thread overview]
Message-ID: <20120624180941.GB5087@phenom.ffwll.local> (raw)
In-Reply-To: <1339669507-6277-3-git-send-email-daniel.vetter@ffwll.ch>

On Thu, Jun 14, 2012 at 12:24:57PM +0200, Daniel Vetter wrote:
> Like for via.
> 
> v2: Actually drop the idlelock again if taken.
> 
> v3: Fixup.
> 
> v4: Fixup the "has master" vs. "is master" confusion the refactor
> introduced.
> 
> v5: Drop the idlelock in the early return path.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

After a few trials of hunting around in the ebay dungeons I've managed to
scrap together a sis system which actually works on mesa 7.11. Hence this
(and the previous sis reworks) are now tested both with and without sis_fb
(different codepaths and memory managers) on a 64bit SMP machine. Card is
a 305 AGP sis:

5:00.0 VGA compatible controller [0300]: Silicon Integrated Systems [SiS] 300/305 PCI/AGP VGA Display Adapter [1039:0300] (rev 90)

Cheers, Daniel
> ---
>  drivers/gpu/drm/sis/sis_drv.c |    3 +--
>  drivers/gpu/drm/sis/sis_mm.c  |   13 +++++++++++--
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
> index c7263a4..614029d 100644
> --- a/drivers/gpu/drm/sis/sis_drv.c
> +++ b/drivers/gpu/drm/sis/sis_drv.c
> @@ -105,10 +105,9 @@ static struct drm_driver driver = {
>  	.load = sis_driver_load,
>  	.unload = sis_driver_unload,
>  	.open = sis_driver_open,
> +	.preclose = sis_reclaim_buffers_locked,
>  	.postclose = sis_driver_postclose,
>  	.dma_quiescent = sis_idle,
> -	.reclaim_buffers = NULL,
> -	.reclaim_buffers_idlelocked = sis_reclaim_buffers_locked,
>  	.lastclose = sis_lastclose,
>  	.ioctls = sis_ioctls,
>  	.fops = &sis_driver_fops,
> diff --git a/drivers/gpu/drm/sis/sis_mm.c b/drivers/gpu/drm/sis/sis_mm.c
> index dd4a316..5acc396 100644
> --- a/drivers/gpu/drm/sis/sis_mm.c
> +++ b/drivers/gpu/drm/sis/sis_mm.c
> @@ -321,14 +321,20 @@ void sis_reclaim_buffers_locked(struct drm_device *dev,
>  	struct sis_file_private *file_priv = file->driver_priv;
>  	struct sis_memblock *entry, *next;
>  
> +	if (!(file->minor->master && file->master->lock.hw_lock))
> +		return;
> +
> +	drm_idlelock_take(&file->master->lock);
> +
>  	mutex_lock(&dev->struct_mutex);
>  	if (list_empty(&file_priv->obj_list)) {
>  		mutex_unlock(&dev->struct_mutex);
> +		drm_idlelock_release(&file->master->lock);
> +
>  		return;
>  	}
>  
> -	if (dev->driver->dma_quiescent)
> -		dev->driver->dma_quiescent(dev);
> +	sis_idle(dev);
>  
>  
>  	list_for_each_entry_safe(entry, next, &file_priv->obj_list,
> @@ -343,6 +349,9 @@ void sis_reclaim_buffers_locked(struct drm_device *dev,
>  		kfree(entry);
>  	}
>  	mutex_unlock(&dev->struct_mutex);
> +
> +	drm_idlelock_release(&file->master->lock);
> +
>  	return;
>  }
>  
> -- 
> 1.7.10
> 

-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2012-06-24 18:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 10:24 [PATCH 00/12] kill-with-fire, resurrected 2nd part Daniel Vetter
2012-06-14 10:24 ` [PATCH 01/12] drm/via: clean up reclaim_buffers Daniel Vetter
2012-06-14 10:24 ` [PATCH 02/12] drm/sis: " Daniel Vetter
2012-06-24 18:09   ` Daniel Vetter [this message]
2012-06-14 10:24 ` [PATCH 03/12] drm: kill reclaim_buffers_idlelocked functions Daniel Vetter
2012-06-14 10:24 ` [PATCH 04/12] Revert "Revert "drm/i810: cleanup reclaim_buffers"" Daniel Vetter
2012-06-14 10:25 ` [PATCH 05/12] drm: kill reclaim_buffers_locked Daniel Vetter
2012-06-14 10:25 ` [PATCH 06/12] drm/savage: clean up reclaim_buffers Daniel Vetter
2012-06-14 10:25 ` [PATCH 07/12] drm: kill reclaim_buffers callback Daniel Vetter
2012-06-14 10:25 ` [PATCH 08/12] drm: ditch strange DRIVER_DMA_QUEUE only error bail-out Daniel Vetter
2012-06-14 10:25 ` [PATCH 09/12] drm: kill dma queue support Daniel Vetter
2012-06-14 10:25 ` [PATCH 10/12] drm: unconditionally clean up dma buffers of closing clients Daniel Vetter
2012-06-14 10:25 ` [PATCH 11/12] drm: kill i915/i830 ids from drm_pciids.h Daniel Vetter
2012-06-14 10:25 ` [PATCH 12/12] drm: kill procfs support Daniel Vetter
2012-07-18 15:58 ` [PATCH 00/12] kill-with-fire, resurrected 2nd part Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120624180941.GB5087@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox