[PATCH 5/6 v3] ASoC: AMD: Audio buffer related changes for Stoney

Mark Brown broonie at kernel.org
Thu Aug 31 11:27:27 UTC 2017


On Fri, Aug 18, 2017 at 02:10:29PM -0400, Alex Deucher wrote:

> +#define ST_PLAYBACK_MAX_PERIOD_SIZE 8192
> +#define ST_CAPTURE_MAX_PERIOD_SIZE  8192
> +#define ST_MAX_BUFFER (ST_PLAYBACK_MAX_PERIOD_SIZE * PLAYBACK_MAX_NUM_PERIODS)

These defines will go wrong if the capture size is changed independently
of the playback size.  Either just use a single define for both or have
separate defines for the maximum buffer as well as for the period.

> +#define ST_MIN_BUFFER ST_MAX_BUFFER
>  static const struct snd_pcm_hardware acp_pcm_hardware_playback = {

Missing blank line between the defines and here.

> +	if (adata->asic_type == CHIP_STONEY)
> +		return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,

As I've said previously it's better to write these variant checks as
switch statements, that way if more variants appear (or special handling
is discovered for existing chips) the code can be modified more cleanly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20170831/95444641/attachment.sig>


More information about the amd-gfx mailing list