diff options
author | Mark Gross <mgross@linux.intel.com> | 2010-05-05 19:59:26 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-05-10 17:08:19 -0400 |
commit | ed77134bfccf5e75b6cbadab268e559dbe6a4ebb (patch) | |
tree | dae087a617ab3d9af8673d1905dbca3bcd57e89e /sound/core | |
parent | 0fef8b1e83c4ab08cf1304dbebcfd749caf4f187 (diff) |
PM QOS update
This patch changes the string based list management to a handle base
implementation to help with the hot path use of pm-qos, it also renames
much of the API to use "request" as opposed to "requirement" that was
used in the initial implementation. I did this because request more
accurately represents what it actually does.
Also, I added a string based ABI for users wanting to use a string
interface. So if the user writes 0xDDDDDDDD formatted hex it will be
accepted by the interface. (someone asked me for it and I don't think
it hurts anything.)
This patch updates some documentation input I got from Randy.
Signed-off-by: markgross <mgross@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm.c | 3 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 0d428d0896db..cbe815dfbdc8 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -648,9 +648,6 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) | |||
648 | substream->number = idx; | 648 | substream->number = idx; |
649 | substream->stream = stream; | 649 | substream->stream = stream; |
650 | sprintf(substream->name, "subdevice #%i", idx); | 650 | sprintf(substream->name, "subdevice #%i", idx); |
651 | snprintf(substream->latency_id, sizeof(substream->latency_id), | ||
652 | "ALSA-PCM%d-%d%c%d", pcm->card->number, pcm->device, | ||
653 | (stream ? 'c' : 'p'), idx); | ||
654 | substream->buffer_bytes_max = UINT_MAX; | 651 | substream->buffer_bytes_max = UINT_MAX; |
655 | if (prev == NULL) | 652 | if (prev == NULL) |
656 | pstr->substream = substream; | 653 | pstr->substream = substream; |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 872887624030..605c86df71c5 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -481,11 +481,13 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, | |||
481 | snd_pcm_timer_resolution_change(substream); | 481 | snd_pcm_timer_resolution_change(substream); |
482 | runtime->status->state = SNDRV_PCM_STATE_SETUP; | 482 | runtime->status->state = SNDRV_PCM_STATE_SETUP; |
483 | 483 | ||
484 | pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, | 484 | if (substream->latency_pm_qos_req) { |
485 | substream->latency_id); | 485 | pm_qos_remove_request(substream->latency_pm_qos_req); |
486 | substream->latency_pm_qos_req = NULL; | ||
487 | } | ||
486 | if ((usecs = period_to_usecs(runtime)) >= 0) | 488 | if ((usecs = period_to_usecs(runtime)) >= 0) |
487 | pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, | 489 | substream->latency_pm_qos_req = pm_qos_add_request( |
488 | substream->latency_id, usecs); | 490 | PM_QOS_CPU_DMA_LATENCY, usecs); |
489 | return 0; | 491 | return 0; |
490 | _error: | 492 | _error: |
491 | /* hardware might be unuseable from this time, | 493 | /* hardware might be unuseable from this time, |
@@ -540,8 +542,8 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream) | |||
540 | if (substream->ops->hw_free) | 542 | if (substream->ops->hw_free) |
541 | result = substream->ops->hw_free(substream); | 543 | result = substream->ops->hw_free(substream); |
542 | runtime->status->state = SNDRV_PCM_STATE_OPEN; | 544 | runtime->status->state = SNDRV_PCM_STATE_OPEN; |
543 | pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, | 545 | pm_qos_remove_request(substream->latency_pm_qos_req); |
544 | substream->latency_id); | 546 | substream->latency_pm_qos_req = NULL; |
545 | return result; | 547 | return result; |
546 | } | 548 | } |
547 | 549 | ||