From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [RFC PATCH 0/2] drm: make drm_get_{connector, encoder}_name thread safe Date: Wed, 14 May 2014 18:59:18 +0300 Message-ID: <8761l8qrl5.fsf@intel.com> References: <20140514141743.GE3417@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 40ADD6E058 for ; Wed, 14 May 2014 09:02:31 -0700 (PDT) In-Reply-To: <20140514141743.GE3417@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Chris Wilson Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, 14 May 2014, Chris Wilson 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