All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "kernel@stlinux.com" <kernel@stlinux.com>,
	Takashi Iwai <tiwai@suse.de>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	Jyri Sarha <jsarha@ti.com>, David Airlie <airlied@linux.ie>,
	"broonie@kernel.org" <broonie@kernel.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 2/2] ASoC: hdmi-codec: add channel mapping control
Date: Tue, 13 Dec 2016 22:23:54 +0900	[thread overview]
Message-ID: <636ed854-e80c-e18c-314d-54c870d2c1bc@sakamocchi.jp> (raw)
In-Reply-To: <6589c8e0-f918-10c3-3d7b-39d50b429850@st.com>

Hi Arnaud,

On Dec 12 2016 22:46, Arnaud Pouliquen wrote:
> On 12/12/2016 01:03 PM, Takashi Sakamoto wrote:
>> On 2016年12月12日 18:38, Arnaud Pouliquen wrote:
>>>>> + */
>>>>> +static struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = {
>>>>> +/*			  channel:   7     6    5    4    3     2    1    0  */
>>>>> +{ .ca_index = 0x00,  .speakers = {   0,    0,   0,   0,   0,    0,  FR,  FL } },
>>>>> +				 /* 2.1 */
>>>>> +{ .ca_index = 0x01,  .speakers = {   0,    0,   0,   0,   0,  LFE,  FR,  FL } },
>>>>> +				 /* Dolby Surround */
>>>>> +{ .ca_index = 0x02,  .speakers = {   0,    0,   0,   0,  FC,    0,  FR,  FL } },
>>>>> +				 /* surround51 */
>>>>> +{ .ca_index = 0x0b,  .speakers = {   0,    0,  RR,  RL,  FC,  LFE,  FR,  FL } },
>>>>> +				 /* surround40 */
>>>>> +{ .ca_index = 0x08,  .speakers = {   0,    0,  RR,  RL,   0,    0,  FR,  FL } },
>>>>> +				 /* surround41 */
>>>>> +{ .ca_index = 0x09,  .speakers = {   0,    0,  RR,  RL,   0,  LFE,  FR,  FL } },
>>>>> +				 /* surround50 */
>>>>> +{ .ca_index = 0x0a,  .speakers = {   0,    0,  RR,  RL,  FC,    0,  FR,  FL } },
>>>>> +				 /* 6.1 */
>>>>> +{ .ca_index = 0x0f,  .speakers = {   0,   RC,  RR,  RL,  FC,  LFE,  FR,  FL } },
>>>>> +				 /* surround71 */
>>>>> +{ .ca_index = 0x13,  .speakers = { RRC,  RLC,  RR,  RL,  FC,  LFE,  FR,  FL } },
>>>>> +
>>>>> +{ .ca_index = 0x03,  .speakers = {   0,    0,   0,   0,  FC,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x04,  .speakers = {   0,    0,   0,  RC,   0,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x05,  .speakers = {   0,    0,   0,  RC,   0,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x06,  .speakers = {   0,    0,   0,  RC,  FC,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x07,  .speakers = {   0,    0,   0,  RC,  FC,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x0c,  .speakers = {   0,   RC,  RR,  RL,   0,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x0d,  .speakers = {   0,   RC,  RR,  RL,   0,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x0e,  .speakers = {   0,   RC,  RR,  RL,  FC,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x10,  .speakers = { RRC,  RLC,  RR,  RL,   0,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x11,  .speakers = { RRC,  RLC,  RR,  RL,   0,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x12,  .speakers = { RRC,  RLC,  RR,  RL,  FC,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x14,  .speakers = { FRC,  FLC,   0,   0,   0,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x15,  .speakers = { FRC,  FLC,   0,   0,   0,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x16,  .speakers = { FRC,  FLC,   0,   0,  FC,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x17,  .speakers = { FRC,  FLC,   0,   0,  FC,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x18,  .speakers = { FRC,  FLC,   0,  RC,   0,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x19,  .speakers = { FRC,  FLC,   0,  RC,   0,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x1a,  .speakers = { FRC,  FLC,   0,  RC,  FC,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x1b,  .speakers = { FRC,  FLC,   0,  RC,  FC,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x1c,  .speakers = { FRC,  FLC,  RR,  RL,   0,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x1d,  .speakers = { FRC,  FLC,  RR,  RL,   0,  LFE,  FR,  FL } },
>>>>> +{ .ca_index = 0x1e,  .speakers = { FRC,  FLC,  RR,  RL,  FC,    0,  FR,  FL } },
>>>>> +{ .ca_index = 0x1f,  .speakers = { FRC,  FLC,  RR,  RL,  FC,  LFE,  FR,  FL } },
>>>>> +};
>>>>
>>>> Ditto.
>>> Sorry not understand this comment vs the previous one, could you please
>>> clarify?
>>
>> This table is invariant in lifetime of the storage object, as well.
>> Let's put into .rodata section, too.
>>
> This table is updated in hdmi_codec_cea_init_channel_alloc so can not be
> constant. In theory i could declare all field instead of computing some.
> But for lisibility, i would prefer to just declare ca_index  and
> speakers allocation field in this table (i will declared both as const)

You should pay enough attention to a case that one system has several 
GPUs to which relevant GPU drivers register HDMI_CODEC_DRV_NAME platform 
device. The 'static' modifier has an effect to keep just one storage 
object, thus your code causes bugs in the case.


Regards

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2016-12-13 13:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 16:37 [PATCH 0/2] Generic HDMI codec: Add channel mapping control Arnaud Pouliquen
2016-12-08 16:37 ` [PATCH 1/2] DRM: add help to get ELD speaker allocation Arnaud Pouliquen
2017-01-20 15:29   ` Applied "DRM: add help to get ELD speaker allocation" to the asoc tree Mark Brown
2016-12-08 16:37 ` [PATCH 2/2] ASoC: hdmi-codec: add channel mapping control Arnaud Pouliquen
2016-12-11  6:09   ` Takashi Sakamoto
2016-12-12  9:38     ` Arnaud Pouliquen
2016-12-12  9:54       ` Takashi Iwai
2016-12-12 12:12         ` Takashi Sakamoto
2016-12-12 12:55           ` Takashi Iwai
2016-12-12 14:05             ` Takashi Sakamoto
2016-12-12 15:12               ` Arnaud Pouliquen
2016-12-12 12:03       ` Takashi Sakamoto
2016-12-12 13:46         ` Arnaud Pouliquen
2016-12-13 13:23           ` Takashi Sakamoto [this message]
2016-12-13 13:58             ` Takashi Sakamoto
2016-12-13 14:49               ` Arnaud Pouliquen
2016-12-12 17:16         ` Arnaud Pouliquen
2016-12-08 20:52 ` [PATCH 0/2] Generic HDMI codec: Add " Takashi Sakamoto
2016-12-08 21:13   ` Takashi Sakamoto
2016-12-09 14:06     ` Arnaud Pouliquen
2016-12-11  1:16       ` Takashi Sakamoto

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=636ed854-e80c-e18c-314d-54c870d2c1bc@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=broonie@kernel.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=kernel@stlinux.com \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.