Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90515440A3F for ; Tue, 28 Jul 2026 13:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785245727; cv=none; b=h4BBxG9XVRYmyeH8TSyyK2iMiqKPTz1fAL/qj0ILfdNYXp1k/RkdsfW7ZIZ1C0TA+sHvEiTbBEZRrGIQRo+fT69cX+bwB9tLeoISa+yPxXKhJ8UIKITtaHpMlEOiidxP8kp5BP1dzzML8pWaf2lV7PklM6qp3lpePIfC0pT41jU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785245727; c=relaxed/simple; bh=uclujyCB5s0Jk6OfdJ/Rz1G4FZel7DHTMc90+3dISfo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bvO1mL/XOeAhVCdS/yG1wxJOCaLrrkDfC1fCaXP5p7e8ahMafIEhHZX9tWjPtD42HPvbsu6J9fpcgv93LOkiOGNk4MnM6PDX2JRuUfClVInw3xlC83ccTUAIgkQdgR4qesxC4MRbRcIDo37usgTToyT2aJQjWX/tEI+DLrPO6x8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kMKdjBpd; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kMKdjBpd" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-49548aebcd8so28763205e9.3 for ; Tue, 28 Jul 2026 06:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785245723; x=1785850523; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=hWKFfRMOGev4kY9jS3nRnQFe62NXbyE1RAtN86oZDL8=; b=kMKdjBpdQP3hVYmbUKvw6wXn9dt2bh87HTD3j+Os/6AcagCoqawS2W+z1KFfvShQt2 TUSPL+xkQ1TBx8hsLq8mWuQ/dDegAQmp+XfJtnmPATIp5gVXOm8faKwn00/FJUimC4Ha C38v4Ha84caBb/RmTDIESznycQWew2T1YJ1ziSPeJFDRfU4IZ/2x/z8fiyzZ7SnZrj3C oW8WnRcLbhpxHWjonIUfhivPzhjZQJ13NNjO42FI8we3+1Twlm7esbsCyAjVW0iQ96Dd k1idhwFjnDTs2Nxjq1rkZrG24TsWNgsiBrcGySl300ORQZEfPgYO/FQgo2l3V/T7QvyT JaZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785245723; x=1785850523; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hWKFfRMOGev4kY9jS3nRnQFe62NXbyE1RAtN86oZDL8=; b=DhwZNI+4w20Z4SgjfXuSTw2b7lxAAyqq6uMIA8nH/YjmRGpxw76h5cj5LT8pgxbAQ2 rWbNfSz0hrjtiiv1q1Gkzsw6aVm1ggR0xYKA7atOk668I1j98ibrsy/Hq7SyE+lP/GKf RpX02aHBU3VXaImMw6Xt3zro28BESERUxaDqLTv3SOSZeEVJOuboxgsYCTzXDuXo+qJ6 IY+CdVE7TVwejEHrWAn0yJawmYa4uokTEC6JLc/FKY1eZVDKDcCOsvPsXGx8lBmKWBrH xwApqkOo+DVXlo0hycXCnIYTtoXcuMTFKqyV25Wn/0TEE9YVA/0My7cFdRKz64U0UDGN ZgFw== X-Forwarded-Encrypted: i=1; AHgh+RoZToKnkdLuz5Bt6ikhRmI07KHcdYdMiDJ0jWpYsdMp6UTQU7ga60uNwR/aBt0GKyr97jKqbCk6oCa61cU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7a15r7uPgAhpYlzZGocxPjfqSbvi9pN1wz8p2daxxRXmhswoS NM0IF7ttygl9/+iUMfwBtJMxsCCkqJWUCTj1tyjrSJrB+9YYxIaeDfUG X-Gm-Gg: AR+sD10MvIRQZwJnaU9rI1Ex3AGbXGAUc37kMEaRHmGsxyUFOD+7zYWSzi/zmDL5u1y viI2EdilS8lxS+MESXiHRDLVnZJ7FCuA1WFbTwTglyg53xkxmiiIaQ/iSZzjcuSzfyG5/aPfGj0 09p0zMK5jjWRVXQFmXv0gzInPMiroKqKkSPKN69XqOkFB5qSgLkSxEyD5uzAMDhOZdQSQOJ0nsf x4NHkNTvshW7UP+X6pfYIw3+A6Q/wj76wtXrJF6z318ABmiqiqBgAYhbJb3pkfI9HlL4mv6Yrh/ CCuA1UA5R/JPBcFwrvzzPKy314m31j7bBXvznmrsjdy+kzs4J9G9r1CeApM7JsHFGEgWP8d6hAU GNQt38TkwOzWDznZWghc16fqTsQQFvCD0zwBZ0bFrs738NpFKB6Z4lWrF8mYgUOnf/G/mVdek X-Received: by 2002:a05:600c:6290:b0:493:f176:dc69 with SMTP id 5b1f17b1804b1-496c65986a2mr26079295e9.37.1785245722321; Tue, 28 Jul 2026 06:35:22 -0700 (PDT) Received: from pop-os ([86.120.213.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496c46240c4sm78616675e9.12.2026.07.28.06.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 06:35:21 -0700 (PDT) From: Baba Dan Constantin To: dri-devel@lists.freedesktop.org Cc: Baba Dan Constantin , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/doc: Add kernel-doc for struct drm_mode_card_res Date: Tue, 28 Jul 2026 16:35:10 +0300 Message-ID: <20260728133511.115212-1-babadany2999@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add missing kernel-doc documentation for struct drm_mode_card_res used by the DRM_IOCTL_MODE_GETRESOURCES ioctl. Signed-off-by: Baba Dan Constantin --- include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 381a3e857d4e..5db85b559bf6 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -249,18 +249,54 @@ struct drm_mode_modeinfo { char name[DRM_DISPLAY_MODE_LEN]; }; +/** + * struct drm_mode_card_res - Get GPU card resources metadata. + * + * User-space can perform a GETRESOURCES ioctl to retrieve information about a + * GPU card. User-space is expected to retrieve framebuffers, CRTC objects, + * connectors and encoders by performing this ioctl at least twice: the first + * time to retrieve the number of elements, the second time to retrieve the + * elements themselves. + * + * To retrieve the number of elements, set @count_fbs, @count_crtcs, + * @count_connectors and @count_encoders to 0. + * + * To retrieve the elements, allocate arrays for @fb_id_ptr, @crtc_id_ptr, + * @connector_id_ptr and @encoder_id_ptr to their capacity. + * + * Performing the ioctl only twice may be racy: the number of elements may have + * changed with a hotplug event in-between the two ioctls. User-space is expected + * to retry the last ioctl until the number of elements stabilizes. + * + * Unlike GETCONNECTOR, GETRESOURCES will fill arrays up to the provided count + * capacity, even if the actual element count has increased. + */ struct drm_mode_card_res { + /** @fb_id_ptr: Pointer to ``__u32`` array of framebuffer IDs. */ __u64 fb_id_ptr; + /** @crtc_id_ptr: Pointer to ``__u32`` array of CRTC IDs. */ __u64 crtc_id_ptr; + /** @connector_id_ptr: Pointer to ``__u32`` array of connector IDs. */ __u64 connector_id_ptr; + /** @encoder_id_ptr: Pointer to ``__u32`` array of encoder IDs. */ __u64 encoder_id_ptr; + + /** @count_fbs: Number of framebuffers. */ __u32 count_fbs; + /** @count_crtcs: Number of CRTCs. */ __u32 count_crtcs; + /** @count_connectors: Number of connectors. */ __u32 count_connectors; + /** @count_encoders: Number of encoders. */ __u32 count_encoders; + + /** @min_width: Minimum framebuffer width supported by this GPU card. */ __u32 min_width; + /** @max_width: Maximum framebuffer width supported by this GPU card. */ __u32 max_width; + /** @min_height: Minimum framebuffer height supported by this GPU card. */ __u32 min_height; + /** @max_height: Maximum framebuffer height supported by this GPU card. */ __u32 max_height; }; -- 2.54.0