Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp736968pxf; Wed, 24 Mar 2021 14:53:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT4MLIGvp+bm/dnMMWl6sd8FcnEBsN/Aj/+8GSOkVlLj1NGYx3gMxvj2tFozjQb0a+B6q0 X-Received: by 2002:a17:906:6c93:: with SMTP id s19mr5885976ejr.151.1616622819686; Wed, 24 Mar 2021 14:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616622819; cv=none; d=google.com; s=arc-20160816; b=YjOB9gO8zIVkwSqGYiSUQiu20Ph+C+jK+BtMCgxAktcez8qE2il2epO97k90BmUPPO GEJ3tLN/hCb8rGC5Qlw0d2SPf9kS7KuESBcW1isrQbo/tO4JHjtBLxTLWyAKLG0pd7bW R1KkZto59CuX87hNwzatPsg94ROOsherBfeRWHhO/9UndPfHZKw7bZZ/oyAw1ND5j+k2 mF/1l5UGu32S1uGA4aHjVnZy01oHQaMOl/sPtc8WhCBWlxpcj0oPLov5gqDit4Q/3Xf7 UKK12fqxv4G796sdGayQx24kuAJ7bLXyZ+0KbI7UnqU3KbQ6BMv07TvUWRdTonM6GKxU 6Xhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pj/ueQVFN36KH6q4Ws6dH9dftT4idb6jbiRIK3I4LaI=; b=Do396VhWK4xjinttosUEAH2Qe4huIqKl0GnIIsYaB3NBGl3TsaabaamM89cL/MRYUo 7CdMEdCEXJ8YL0sJ/0kmqTwRKfTWfY4nTdMjXIJxo6R4w3GLn0WGYLzIbB3F+ReMOn3m 2v6MT54KgQ/CPI/ghW9cpK0tVvxiXyIeDdc/yA42twdVj5b6+t6o0M32/sSqSLjs1bpJ 6s2GH9CwgO07DQ+TydD1+INPk6YmNpS7S1V16yJE74OqlNazHyQdCSGAYCFO1zA0Y4r9 EAPeULvMCHZ7J+8SQYE+SMPbpSQ0xj3BoVGMoW6I//C2d0ltE1mVxs9ReXgTjG9IXpM5 YkLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=G2hljkGB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx8si2664563edb.517.2021.03.24.14.53.16; Wed, 24 Mar 2021 14:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=G2hljkGB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbhCXC0J (ORCPT + 99 others); Tue, 23 Mar 2021 22:26:09 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50518 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbhCXCZe (ORCPT ); Tue, 23 Mar 2021 22:25:34 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 92A7F580; Wed, 24 Mar 2021 03:25:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616552732; bh=yQk2Et593ck5JEiyof4AfzdzEASSQa7eRxQPm/iZHL4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G2hljkGBJ/mQhub4L5wvIJdf4861qlayDfVzGuRCTTzaNOlR9aKpRt1plscTOnnba q1C/7dP/0GIWrdAEe7BB+4TcFQIsg+X2oiHmU40HfBZdOf7dCk8CmGMOd2UuFMGew4 WjRgoZ2RlK+oWWWmGx0yX/CaePyL/BOYxTBQ+OZg= Date: Wed, 24 Mar 2021 04:24:50 +0200 From: Laurent Pinchart To: Paul Cercueil Cc: David Airlie , Daniel Vetter , linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, od@zcrc.me, Sam Ravnborg Subject: Re: [PATCH v3 2/4] drm/simple_kms_helper: Add macro drmm_plain_simple_encoder_alloc() Message-ID: References: <20210124085552.29146-1-paul@crapouillou.net> <20210124085552.29146-3-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210124085552.29146-3-paul@crapouillou.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, Thank you for the patch. On Sun, Jan 24, 2021 at 08:55:50AM +0000, Paul Cercueil wrote: > This performs the same operation as drmm_simple_encoder_alloc(), but > only allocates and returns a struct drm_encoder instance. > > Signed-off-by: Paul Cercueil > --- > include/drm/drm_simple_kms_helper.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h > index e6dbf3161c2f..f07e70303cfb 100644 > --- a/include/drm/drm_simple_kms_helper.h > +++ b/include/drm/drm_simple_kms_helper.h > @@ -209,4 +209,21 @@ void *__drmm_simple_encoder_alloc(struct drm_device *dev, size_t size, > offsetof(type, member), \ > encoder_type)) > > +/** > + * drmm_plain_simple_encoder_alloc - Allocate and initialize a drm_encoder > + * struct with basic functionality. > + * @dev: drm device > + * @encoder_type: user visible type of the encoder > + * > + * This performs the same operation as drmm_simple_encoder_alloc(), but > + * only allocates and returns a struct drm_encoder instance. > + * > + * Returns: > + * Pointer to the new drm_encoder struct, or ERR_PTR on failure. > + */ > +#define drmm_plain_simple_encoder_alloc(dev, encoder_type) \ > + ((struct drm_encoder *) \ > + __drmm_simple_encoder_alloc(dev, sizeof(struct drm_encoder), \ > + 0, encoder_type)) > + As this isn't related to the simple encoder helper anymore, how about using __drmm_encoder_alloc instead ? #define drmm_plain_simple_encoder_alloc(dev, encoder_type) \ ((struct drm_encoder *) \ __drmm_encoder_alloc(dev, sizeof(struct drm_encoder), 0, NULL, \ encoder_type, NULL)) I'd also rename the macro to drmm_plain_encoder_alloc(), and move it to drm_encoder.h. That way drivers that don't need the simple KMS helper won't have to select it just for this. > #endif /* __LINUX_DRM_SIMPLE_KMS_HELPER_H */ -- Regards, Laurent Pinchart