dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [RFC PATCH 0/2] drm: make drm_get_{connector, encoder}_name thread safe
Date: Wed, 14 May 2014 18:59:18 +0300	[thread overview]
Message-ID: <8761l8qrl5.fsf@intel.com> (raw)
In-Reply-To: <20140514141743.GE3417@nuc-i3427.alporthouse.com>

On Wed, 14 May 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Wed, May 14, 2014 at 04:58:18PM +0300, Jani Nikula wrote:
>> Hi all -
>> 
>> This series stores connector/encoder names in the relevant structs to
>> make the name getters thread safe.
>> 
>> What say you, is the wasted memory too high a price to pay for the
>> thread safety and implementation simplicity of this approach? I think
>> making drm_get_connector_name and drm_get_encoder_name return allocated
>> buffers makes a lot of code really ugly and error prone.
>
> I thought we could use dev_set_name(connector->kdev, "foo").

Hmm, connector->kdev is created at drm_sysfs_connector_add(), and it
uses a drm_get_connector_name() prefixed with "cardN-". So there's the
naming difference and the lifetime difference, and additionally encoder
doesn't have anything similar. Unless I'm missing something, what I'm
suggesting is way simpler.

BR,
Jani.


> -Chris
>
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Jani Nikula, Intel Open Source Technology Center

  reply	other threads:[~2014-05-14 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 13:58 [RFC PATCH 0/2] drm: make drm_get_{connector, encoder}_name thread safe Jani Nikula
2014-05-14 13:58 ` [RFC PATCH 1/2] drm: store connector name in connector struct Jani Nikula
2014-05-19 11:08   ` David Herrmann
2014-05-27  6:01   ` Dave Airlie
2014-05-27  6:18     ` Jani Nikula
2014-05-14 13:58 ` [RFC PATCH 2/2] drm: store encoder name in encoder struct Jani Nikula
2014-05-19 13:08   ` David Herrmann
2014-05-14 14:17 ` [RFC PATCH 0/2] drm: make drm_get_{connector, encoder}_name thread safe Chris Wilson
2014-05-14 15:59   ` Jani Nikula [this message]
2014-05-19 11:11 ` David Herrmann

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=8761l8qrl5.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox