From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: [RFC PATCH 0/2] drm: make drm_get_{connector, encoder}_name thread safe Date: Wed, 14 May 2014 16:58:18 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C4086E521 for ; Wed, 14 May 2014 06:58:24 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org Cc: jani.nikula@intel.com List-Id: dri-devel@lists.freedesktop.org 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 am assuming connector_type, connector_type_id, encoder_type, and encoder.base.id remain unchanged for the lifetime of the connector/encoder - is that a correct assumption? BR, Jani. N.B. I did not actually test this... Jani Nikula (2): drm: store connector name in connector struct drm: store encoder name in encoder struct drivers/gpu/drm/drm_crtc.c | 67 +++++++++++++++++++++++++--------------------- include/drm/drm_crtc.h | 4 +++ 2 files changed, 41 insertions(+), 30 deletions(-) -- 1.9.1