[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Christian König
From: Christian Koenig So we can skip the looking. Also renames sw_int to ring_int, cause that better matches its purpose. Signed-off-by: Christian Koenig --- drivers/gpu/drm/radeon/evergreen.c | 32 - drivers/gpu/drm/radeon/r100.c | 10 +++--- drivers/gpu/dr

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Michel Dänzer
On Fre, 2012-06-01 at 12:44 +0200, Christian K?nig wrote: > On 01.06.2012 08:30, Michel D?nzer wrote: > > On Fre, 2012-06-01 at 08:19 +0200, Michel D?nzer wrote: > >> I think this might introduce a race condition: > >> > >> Thread 0 Thread 1 > >> > >> atomic_inc_return() returns

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Christian König
On 01.06.2012 08:30, Michel D?nzer wrote: > On Fre, 2012-06-01 at 08:19 +0200, Michel D?nzer wrote: >> I think this might introduce a race condition: >> >> Thread 0 Thread 1 >> >> atomic_inc_return() returns 1 >> spin_lock_irqsave() >> atomic_dec_and_test() >> radeon_irq_set() >>

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Michel Dänzer
On Fre, 2012-06-01 at 08:19 +0200, Michel D?nzer wrote: > > I think this might introduce a race condition: > > Thread 0 Thread 1 > > atomic_inc_return() returns 1 > spin_lock_irqsave() > atomic_dec_and_test() > radeon_irq_set() > > => the interrupt won't be enabled. Hrmm, I m

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Michel Dänzer
On Don, 2012-05-31 at 22:16 +0200, Christian K?nig wrote: > > So we can skip the looking. 'locking' > diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c > b/drivers/gpu/drm/radeon/radeon_irq_kms.c > index 73cd0fd..52f85ba 100644 > --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c > +++ b/driver

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Christian König
From: Christian Koenig So we can skip the looking. Also renames sw_int to ring_int, cause that better matches its purpose. Signed-off-by: Christian Koenig --- drivers/gpu/drm/radeon/evergreen.c | 32 - drivers/gpu/drm/radeon/r100.c | 10 +++--- drivers/gpu/dr

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Michel Dänzer
On Fre, 2012-06-01 at 12:44 +0200, Christian König wrote: > On 01.06.2012 08:30, Michel Dänzer wrote: > > On Fre, 2012-06-01 at 08:19 +0200, Michel Dänzer wrote: > >> I think this might introduce a race condition: > >> > >> Thread 0 Thread 1 > >> > >> atomic_inc_return() returns

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-06-01 Thread Christian König
On 01.06.2012 08:30, Michel Dänzer wrote: On Fre, 2012-06-01 at 08:19 +0200, Michel Dänzer wrote: I think this might introduce a race condition: Thread 0 Thread 1 atomic_inc_return() returns 1 spin_lock_irqsave() atomic_dec_and_test() radeon_irq_set() => the interrupt won't

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-31 Thread Michel Dänzer
On Fre, 2012-06-01 at 08:19 +0200, Michel Dänzer wrote: > > I think this might introduce a race condition: > > Thread 0 Thread 1 > > atomic_inc_return() returns 1 > spin_lock_irqsave() > atomic_dec_and_test() > radeon_irq_set() > > => the interrupt won't be enabled. Hrmm, I m

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-31 Thread Michel Dänzer
On Don, 2012-05-31 at 22:16 +0200, Christian König wrote: > > So we can skip the looking. 'locking' > diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c > b/drivers/gpu/drm/radeon/radeon_irq_kms.c > index 73cd0fd..52f85ba 100644 > --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c > +++ b/driver

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-31 Thread Christian König
From: Christian Koenig So we can skip the looking. Also renames sw_int to ring_int, cause that better matches its purpose. Signed-off-by: Christian Koenig --- drivers/gpu/drm/radeon/evergreen.c | 32 - drivers/gpu/drm/radeon/r100.c | 10 +++--- drivers/gpu/dr

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-31 Thread Christian König
From: Christian Koenig So we can skip the looking. Also renames sw_int to ring_int, cause that better matches its purpose. Signed-off-by: Christian Koenig --- drivers/gpu/drm/radeon/evergreen.c | 32 - drivers/gpu/drm/radeon/r100.c | 10 +++--- drivers/gpu/dr

RE: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-25 Thread Koenig, Christian
> -Original Message- > From: Sylvain BERTRAND [mailto:sylw...@legeek.net] > Sent: Thursday, May 24, 2012 1:59 PM > To: Christian König > Cc: j.gli...@gmail.com; Koenig, Christian; dri-devel@lists.freedesktop.org > Subject: Re: [PATCH 08/10] drm/radeon: replace pflip a

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Sylvain BERTRAND
> Does the linux API mandates atomic_t to be a 32bits word? AFAIK it is, at least for the platforms we care about. ... >>> >>> Then, the proper course of action would be to add to the linux API, sized >>> atomic operation first, wouldn't it? >> >> No, atomic is fine for this, I t

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Sylvain BERTRAND
>> Does the linux API mandates atomic_t to be a 32bits word? > > AFAIK it is, at least for the platforms we care about. > ... Then, the proper course of action would be to add to the linux API, sized atomic operation first, wouldn't it? -- Sylvain

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Sylvain BERTRAND
> + atomic_tring_int[RADEON_NUM_RINGS]; > boolcrtc_vblank_int[RADEON_MAX_CRTCS]; > - boolpflip[RADEON_MAX_CRTCS]; > - int pflip_refcount[RADEON_MAX_CRTCS]; > + atomic_t

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Dave Airlie
On Thu, May 24, 2012 at 1:53 PM, Dave Airlie wrote: > On Thu, May 24, 2012 at 1:46 PM, Sylvain BERTRAND > wrote: Does the linux API mandates atomic_t to be a 32bits word? >>> >>> AFAIK it is, at least for the platforms we care about. >>> ... >> >> Then, the proper course of action would be

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Dave Airlie
On Thu, May 24, 2012 at 1:46 PM, Sylvain BERTRAND wrote: >>> Does the linux API mandates atomic_t to be a 32bits word? >> >> AFAIK it is, at least for the platforms we care about. >> ... > > Then, the proper course of action would be to add to the linux API, sized > atomic operation first, wouldn'

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Koenig, Christian
> -Original Message- > From: Sylvain BERTRAND [mailto:sylware at legeek.net] > Sent: Thursday, May 24, 2012 1:59 PM > To: Christian K?nig > Cc: j.glisse at gmail.com; Koenig, Christian; dri-devel at > lists.freedesktop.org > Subject: Re: [PATCH 08/10] drm/radeon: rep

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Christian König
From: Christian Koenig So we can skip the looking. Also renames sw_int to ring_int, cause that better matches its purpose. Signed-off-by: Christian Koenig --- drivers/gpu/drm/radeon/evergreen.c | 32 - drivers/gpu/drm/radeon/r100.c | 10 +++--- drivers/gpu/dr

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Sylvain BERTRAND
> Does the linux API mandates atomic_t to be a 32bits word? AFAIK it is, at least for the platforms we care about. ... >>> >>> Then, the proper course of action would be to add to the linux API, sized >>> atomic operation first, wouldn't it? >> >> No, atomic is fine for this, I t

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Dave Airlie
On Thu, May 24, 2012 at 1:53 PM, Dave Airlie wrote: > On Thu, May 24, 2012 at 1:46 PM, Sylvain BERTRAND wrote: Does the linux API mandates atomic_t to be a 32bits word? >>> >>> AFAIK it is, at least for the platforms we care about. >>> ... >> >> Then, the proper course of action would be to

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Dave Airlie
On Thu, May 24, 2012 at 1:46 PM, Sylvain BERTRAND wrote: >>> Does the linux API mandates atomic_t to be a 32bits word? >> >> AFAIK it is, at least for the platforms we care about. >> ... > > Then, the proper course of action would be to add to the linux API, sized > atomic operation first, wouldn'

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Sylvain BERTRAND
>> Does the linux API mandates atomic_t to be a 32bits word? > > AFAIK it is, at least for the platforms we care about. > ... Then, the proper course of action would be to add to the linux API, sized atomic operation first, wouldn't it? -- Sylvain ___

Re: [PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Sylvain BERTRAND
> + atomic_tring_int[RADEON_NUM_RINGS]; > boolcrtc_vblank_int[RADEON_MAX_CRTCS]; > - boolpflip[RADEON_MAX_CRTCS]; > - int pflip_refcount[RADEON_MAX_CRTCS]; > + atomic_t

[PATCH 08/10] drm/radeon: replace pflip and sw_int counters with atomics

2012-05-24 Thread Christian König
From: Christian Koenig So we can skip the looking. Also renames sw_int to ring_int, cause that better matches its purpose. Signed-off-by: Christian Koenig --- drivers/gpu/drm/radeon/evergreen.c | 32 - drivers/gpu/drm/radeon/r100.c | 10 +++--- drivers/gpu/dr