Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] media: ALSA memalloc cleanups
@ 2019-11-08 16:36 Takashi Iwai
  2019-11-08 16:36 ` [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data() Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Takashi Iwai @ 2019-11-08 16:36 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab

Hi,

this is a couple of cleanups for media subsystem wrt ALSA memory
allocation API usages.  It's based on the recent API changes that are
found in for-next of my sound git tree for 5.5 kernel, hence these
patches need to be applied on top of it.

So, just give me ACK if they are OK, so that I can apply them.


thanks,

Takashi

===

Takashi Iwai (2):
  media: solo6x10: Remove superfluous snd_dma_continuous_data()
  media: tw686x: audio: Avoid non-standard macro usage

 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 drivers/media/pci/tw686x/tw686x-audio.c    | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.16.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data()
  2019-11-08 16:36 [PATCH 0/2] media: ALSA memalloc cleanups Takashi Iwai
@ 2019-11-08 16:36 ` Takashi Iwai
  2019-11-10 10:04   ` Hans Verkuil
  2019-11-08 16:36 ` [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage Takashi Iwai
  2019-11-10 10:05 ` [PATCH 0/2] media: ALSA memalloc cleanups Hans Verkuil
  2 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2019-11-08 16:36 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab

The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL
device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation
helper accepting NULL as the device pointer for the default usage.
Drop the snd_dma_continuous_data() usage that became superfluous from
the callers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
index 30c8f2ec9c3c..eaa57d835ea8 100644
--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
@@ -353,7 +353,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm,
 					SNDRV_DMA_TYPE_CONTINUOUS,
-					snd_dma_continuous_data(GFP_KERNEL),
+					NULL,
 					G723_PERIOD_BYTES * PERIODS,
 					G723_PERIOD_BYTES * PERIODS);
 
diff --git a/drivers/media/usb/usbtv/usbtv-audio.c b/drivers/media/usb/usbtv/usbtv-audio.c
index 6f108996142d..e746c8ddfc49 100644
--- a/drivers/media/usb/usbtv/usbtv-audio.c
+++ b/drivers/media/usb/usbtv/usbtv-audio.c
@@ -378,8 +378,7 @@ int usbtv_audio_init(struct usbtv *usbtv)
 
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usbtv_pcm_ops);
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
-		snd_dma_continuous_data(GFP_KERNEL), USBTV_AUDIO_BUFFER,
-		USBTV_AUDIO_BUFFER);
+		NULL, USBTV_AUDIO_BUFFER, USBTV_AUDIO_BUFFER);
 
 	rv = snd_card_register(card);
 	if (rv)
-- 
2.16.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage
  2019-11-08 16:36 [PATCH 0/2] media: ALSA memalloc cleanups Takashi Iwai
  2019-11-08 16:36 ` [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data() Takashi Iwai
@ 2019-11-08 16:36 ` Takashi Iwai
  2019-11-10 10:04   ` Hans Verkuil
  2019-11-10 10:05 ` [PATCH 0/2] media: ALSA memalloc cleanups Hans Verkuil
  2 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2019-11-08 16:36 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab

Pass the device pointer from the PCI pointer directly, instead of a
non-standard macro.  The macro didn't give any better readability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/media/pci/tw686x/tw686x-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/tw686x/tw686x-audio.c b/drivers/media/pci/tw686x/tw686x-audio.c
index 40373bd23381..7786e51d19ae 100644
--- a/drivers/media/pci/tw686x/tw686x-audio.c
+++ b/drivers/media/pci/tw686x/tw686x-audio.c
@@ -300,7 +300,7 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm,
 				SNDRV_DMA_TYPE_DEV,
-				snd_dma_pci_data(dev->pci_dev),
+				&dev->pci_dev->dev,
 				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
 				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
 	return 0;
-- 
2.16.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data()
  2019-11-08 16:36 ` [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data() Takashi Iwai
@ 2019-11-10 10:04   ` Hans Verkuil
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Verkuil @ 2019-11-10 10:04 UTC (permalink / raw)
  To: Takashi Iwai, linux-media; +Cc: Mauro Carvalho Chehab

On 11/8/19 5:36 PM, Takashi Iwai wrote:
> The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL
> device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation
> helper accepting NULL as the device pointer for the default usage.
> Drop the snd_dma_continuous_data() usage that became superfluous from
> the callers.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Thanks!

	Hans

> ---
>  drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
>  drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index 30c8f2ec9c3c..eaa57d835ea8 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -353,7 +353,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>  
>  	snd_pcm_lib_preallocate_pages_for_all(pcm,
>  					SNDRV_DMA_TYPE_CONTINUOUS,
> -					snd_dma_continuous_data(GFP_KERNEL),
> +					NULL,
>  					G723_PERIOD_BYTES * PERIODS,
>  					G723_PERIOD_BYTES * PERIODS);
>  
> diff --git a/drivers/media/usb/usbtv/usbtv-audio.c b/drivers/media/usb/usbtv/usbtv-audio.c
> index 6f108996142d..e746c8ddfc49 100644
> --- a/drivers/media/usb/usbtv/usbtv-audio.c
> +++ b/drivers/media/usb/usbtv/usbtv-audio.c
> @@ -378,8 +378,7 @@ int usbtv_audio_init(struct usbtv *usbtv)
>  
>  	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usbtv_pcm_ops);
>  	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
> -		snd_dma_continuous_data(GFP_KERNEL), USBTV_AUDIO_BUFFER,
> -		USBTV_AUDIO_BUFFER);
> +		NULL, USBTV_AUDIO_BUFFER, USBTV_AUDIO_BUFFER);
>  
>  	rv = snd_card_register(card);
>  	if (rv)
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage
  2019-11-08 16:36 ` [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage Takashi Iwai
@ 2019-11-10 10:04   ` Hans Verkuil
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Verkuil @ 2019-11-10 10:04 UTC (permalink / raw)
  To: Takashi Iwai, linux-media; +Cc: Mauro Carvalho Chehab

On 11/8/19 5:36 PM, Takashi Iwai wrote:
> Pass the device pointer from the PCI pointer directly, instead of a
> non-standard macro.  The macro didn't give any better readability.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Thanks!

	Hans

> ---
>  drivers/media/pci/tw686x/tw686x-audio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/tw686x/tw686x-audio.c b/drivers/media/pci/tw686x/tw686x-audio.c
> index 40373bd23381..7786e51d19ae 100644
> --- a/drivers/media/pci/tw686x/tw686x-audio.c
> +++ b/drivers/media/pci/tw686x/tw686x-audio.c
> @@ -300,7 +300,7 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
>  
>  	snd_pcm_lib_preallocate_pages_for_all(pcm,
>  				SNDRV_DMA_TYPE_DEV,
> -				snd_dma_pci_data(dev->pci_dev),
> +				&dev->pci_dev->dev,
>  				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
>  				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
>  	return 0;
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] media: ALSA memalloc cleanups
  2019-11-08 16:36 [PATCH 0/2] media: ALSA memalloc cleanups Takashi Iwai
  2019-11-08 16:36 ` [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data() Takashi Iwai
  2019-11-08 16:36 ` [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage Takashi Iwai
@ 2019-11-10 10:05 ` Hans Verkuil
  2019-11-11  8:14   ` Takashi Iwai
  2 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2019-11-10 10:05 UTC (permalink / raw)
  To: Takashi Iwai, linux-media; +Cc: Mauro Carvalho Chehab

On 11/8/19 5:36 PM, Takashi Iwai wrote:
> Hi,
> 
> this is a couple of cleanups for media subsystem wrt ALSA memory
> allocation API usages.  It's based on the recent API changes that are
> found in for-next of my sound git tree for 5.5 kernel, hence these
> patches need to be applied on top of it.
> 
> So, just give me ACK if they are OK, so that I can apply them.

I Acked them. Mauro is very busy so you'll have to do with my Ack,
and anyway I maintain those drivers.

Regards,

	Hans

> 
> 
> thanks,
> 
> Takashi
> 
> ===
> 
> Takashi Iwai (2):
>   media: solo6x10: Remove superfluous snd_dma_continuous_data()
>   media: tw686x: audio: Avoid non-standard macro usage
> 
>  drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
>  drivers/media/pci/tw686x/tw686x-audio.c    | 2 +-
>  drivers/media/usb/usbtv/usbtv-audio.c      | 3 +--
>  3 files changed, 3 insertions(+), 4 deletions(-)
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] media: ALSA memalloc cleanups
  2019-11-10 10:05 ` [PATCH 0/2] media: ALSA memalloc cleanups Hans Verkuil
@ 2019-11-11  8:14   ` Takashi Iwai
  0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2019-11-11  8:14 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, Mauro Carvalho Chehab

On Sun, 10 Nov 2019 11:05:53 +0100,
Hans Verkuil wrote:
> 
> On 11/8/19 5:36 PM, Takashi Iwai wrote:
> > Hi,
> > 
> > this is a couple of cleanups for media subsystem wrt ALSA memory
> > allocation API usages.  It's based on the recent API changes that are
> > found in for-next of my sound git tree for 5.5 kernel, hence these
> > patches need to be applied on top of it.
> > 
> > So, just give me ACK if they are OK, so that I can apply them.
> 
> I Acked them. Mauro is very busy so you'll have to do with my Ack,
> and anyway I maintain those drivers.

OK, thanks!  I queued these fixed now.


Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 16:36 [PATCH 0/2] media: ALSA memalloc cleanups Takashi Iwai
2019-11-08 16:36 ` [PATCH 1/2] media: solo6x10: Remove superfluous snd_dma_continuous_data() Takashi Iwai
2019-11-10 10:04   ` Hans Verkuil
2019-11-08 16:36 ` [PATCH 2/2] media: tw686x: audio: Avoid non-standard macro usage Takashi Iwai
2019-11-10 10:04   ` Hans Verkuil
2019-11-10 10:05 ` [PATCH 0/2] media: ALSA memalloc cleanups Hans Verkuil
2019-11-11  8:14   ` Takashi Iwai

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git