[RFC PATCH 0/2] drm: make drm_get_{connector, encoder}_name thread safe
Jani Nikula
jani.nikula at intel.com
Wed May 14 08:59:18 PDT 2014
On Wed, 14 May 2014, Chris Wilson <chris at 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
More information about the dri-devel
mailing list