Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2268501pxb; Sun, 24 Jan 2021 01:02:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7aqc5UBwUwmxJpw43gswWc4QOobotaKON13fWXHseReQH+J5WULoRfVIZjVol1EZIVJhu X-Received: by 2002:a17:906:97c5:: with SMTP id ef5mr32112ejb.347.1611478952917; Sun, 24 Jan 2021 01:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611478952; cv=none; d=google.com; s=arc-20160816; b=P2qHs8s8UTZhF3WwtRIu1XGv/5BElx75o1COsCgcLQqFVV94kqhDyd4vmFgSHoQnSt TPm4Nl+XUysLnKSkNGWLp0Ixz98rnIIVD53qBswU6aDcc6Ck0IB3lqxYbXi6A8YIUxkx vWZsBmhoPDagTyftF23eNHQIbjKfsA42TDWgp/QEiPiictGreR2Gnmq1eigzXbz6r5aZ LUCY7P+AQ4/pF++BPa52ulYhrJnR6c5w2NLsKjCX1zLakNbKhlivr7bEA0jyWmtF5L5W U7gji45+ifatNfy4BwWsurKBXtnMgOEjY8XOBF3mG/kKjOjhflS2o7SH0NSyhQCcAz1w nSYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3++7OW3oNuNv/VwjiHlb0j3UdyzkGBGLBtqtCPHOVIo=; b=RMAuUcUz0vmGRPtIJTAAYn7MKB8OQzHYG+ZbSOytmQ17i4Inl/Grc0ulCEo5RjnH8E hPwczh1xx5sPN7LVVMBBXse4lfXWA6e8C2Rsh+Pca4IMyIl7IayYYs2einR8IiSU4yMy f5dbcr/i+M9Nt1E3+tEsf97PD4m5UAHp1MCGwvG4v7tG3AuYl5ha9YYtYHQ3scj8CNC/ rApowyH6q2RB0/xTkzIJtCLX+Qn7X1+FOOsB4H6mvXWhJeXF7QrAXY4FP0cqSBYG25XT k54cXSrMcPPApWCF78gLo+AfvBf/P4sPfiavxh88obMIKsGNIUbmm74/fHOXWjCTjqef Au0g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si5754340edv.507.2021.01.24.01.02.09; Sun, 24 Jan 2021 01:02:32 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbhAXI6k (ORCPT + 99 others); Sun, 24 Jan 2021 03:58:40 -0500 Received: from aposti.net ([89.234.176.197]:43698 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbhAXI6a (ORCPT ); Sun, 24 Jan 2021 03:58:30 -0500 From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: Sam Ravnborg , Laurent Pinchart , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 2/4] drm/simple_kms_helper: Add macro drmm_plain_simple_encoder_alloc() Date: Sun, 24 Jan 2021 08:55:50 +0000 Message-Id: <20210124085552.29146-3-paul@crapouillou.net> In-Reply-To: <20210124085552.29146-1-paul@crapouillou.net> References: <20210124085552.29146-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) + #endif /* __LINUX_DRM_SIMPLE_KMS_HELPER_H */ -- 2.29.2