From patchwork Fri Feb 11 12:51:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwan-gyeong Mun X-Patchwork-Id: 12743409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5C13C433F5 for ; Fri, 11 Feb 2022 12:51:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AADF810EBE0; Fri, 11 Feb 2022 12:51:30 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FCBC10EBE0 for ; Fri, 11 Feb 2022 12:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644583889; x=1676119889; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=uMbpACJcAbRsd//hSfssVqdEtmlKEeNenIZjwLQPQug=; b=Q8q0rpdqar9O67uDgafBTxpy/aDrUtbBSubEOdSgYjFAl2oGZpeA2qPy q/0DdOWZ4+4pWYxtGWegzJmgGACswTKiryX9O7SH7yTzd9kzjTjgibxPH pNgPfHMMIPbIM2q7CpbTDVcNlUFeKdIFzrxJccG93yxE4Bj7EPtiUSymS 8R91lOeEJ9I3UMPGoYy22PMdEBPXxlxcCtgYhte7dYk3te11GQS+8gJR6 k8D+jwV+0H+eXgIg7He5mwib7qadbvJ7o1Lf5UGGYfVJbDgrAKdnXkfRQ Ybvxo/OLGfn2sD6bMP3DfF11hB79UZNd3cPSbqG+goBscQ598FhuSx2CS g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="336147823" X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="336147823" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 04:51:14 -0800 X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="542079612" Received: from slodes-mobl2.ger.corp.intel.com (HELO hades.ger.corp.intel.com) ([10.252.57.30]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 04:51:11 -0800 From: Gwan-gyeong Mun To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/doc: Fix typos and update outdated structure and API names Date: Fri, 11 Feb 2022 14:51:00 +0200 Message-Id: <20220211125100.3870480-1-gwan-gyeong.mun@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tzimmermann@suse.de, airlied@linux.ie, ray.huang@amd.com, christian.koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It fixes typo and updates outdated struct and API names that are currently deprecated or in use but have changed on the kernel documents of DRM section and comments. Signed-off-by: Gwan-gyeong Mun --- Documentation/gpu/drm-mm.rst | 8 ++++---- drivers/gpu/drm/drm_file.c | 10 +++++----- drivers/gpu/drm/drm_gem_vram_helper.c | 18 ++++++++---------- drivers/gpu/drm/ttm/ttm_pool.c | 2 +- include/drm/drm_device.h | 8 ++++++-- include/drm/drm_drv.h | 6 +++--- include/drm/drm_gem_cma_helper.h | 2 +- include/drm/drm_gem_vram_helper.h | 1 - 8 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 198bcc1affa1..0451e6ca7402 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -266,13 +266,13 @@ argument. The GEM core provides a helper method drm_gem_mmap() to handle object mapping. The method can be set directly as the mmap file operation handler. It will look up the GEM object based on the offset -value and set the VMA operations to the :c:type:`struct drm_driver -` gem_vm_ops field. Note that drm_gem_mmap() doesn't map memory to +value and set the VMA operations to the :c:type:`struct drm_gem_object_funcs +` vm_ops field. Note that drm_gem_mmap() doesn't map memory to userspace, but relies on the driver-provided fault handler to map pages individually. -To use drm_gem_mmap(), drivers must fill the struct :c:type:`struct drm_driver -` gem_vm_ops field with a pointer to VM operations. +To use drm_gem_mmap(), drivers must fill the struct :c:type:`struct drm_gem_object_funcs +` vm_ops field with a pointer to VM operations. The VM operations is a :c:type:`struct vm_operations_struct ` made up of several fields, the more interesting ones being: diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index ed25168619fc..21ca97cf7670 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -553,8 +553,8 @@ EXPORT_SYMBOL(drm_release_noglobal); * means all modern display drivers must use it. * * @offset is ignored, DRM events are read like a pipe. Therefore drivers also - * must set the &file_operation.llseek to no_llseek(). Polling support is - * provided by drm_poll(). + * must set the &file_operation.llseek to no_llseek() or noop_llseek(). + * Polling support is provided by drm_poll(). * * This function will only ever read a full event. Therefore userspace must * supply a big enough buffer to fit any event to ensure forward progress. Since @@ -640,7 +640,7 @@ EXPORT_SYMBOL(drm_read); * @filp: file pointer * @wait: poll waiter table * - * This function must be used by drivers as their &file_operations.read method + * This function must be used by drivers as their &file_operations.poll method * if they use DRM events for asynchronous signalling to userspace. Since * events are used by the KMS API for vblank and page flip completion this means * all modern display drivers must use it. @@ -674,7 +674,7 @@ EXPORT_SYMBOL(drm_poll); * * This function prepares the passed in event for eventual delivery. If the event * doesn't get delivered (because the IOCTL fails later on, before queuing up - * anything) then the even must be cancelled and freed using + * anything) then the event must be cancelled and freed using * drm_event_cancel_free(). Successfully initialized events should be sent out * using drm_send_event() or drm_send_event_locked() to signal completion of the * asynchronous event to userspace. @@ -716,7 +716,7 @@ EXPORT_SYMBOL(drm_event_reserve_init_locked); * * This function prepares the passed in event for eventual delivery. If the event * doesn't get delivered (because the IOCTL fails later on, before queuing up - * anything) then the even must be cancelled and freed using + * anything) then the event must be cancelled and freed using * drm_event_cancel_free(). Successfully initialized events should be sent out * using drm_send_event() or drm_send_event_locked() to signal completion of the * asynchronous event to userspace. diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index dc7f938bfff2..a43c550900ec 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -39,25 +39,23 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs; * provide an implementation that suits the hardware. If the hardware device * contains dedicated video memory, the DRM driver can use the VRAM helper * library. Each active buffer object is stored in video RAM. Active - * buffer are used for drawing the current frame, typically something like + * buffers are used for drawing the current frame, typically something like * the frame's scanout buffer or the cursor image. If there's no more space * left in VRAM, inactive GEM objects can be moved to system memory. * - * To initialize the VRAM helper library call drmm_vram_helper_alloc_mm(). + * To initialize the VRAM helper library call drmm_vram_helper_init(). * The function allocates and initializes an instance of &struct drm_vram_mm * in &struct drm_device.vram_mm . Use &DRM_GEM_VRAM_DRIVER to initialize - * &struct drm_driver and &DRM_VRAM_MM_FILE_OPERATIONS to initialize + * &struct drm_driver and &DEFINE_DRM_GEM_FOPS to initialize * &struct file_operations; as illustrated below. * * .. code-block:: c * - * struct file_operations fops ={ - * .owner = THIS_MODULE, - * DRM_VRAM_MM_FILE_OPERATION - * }; + * DEFINE_DRM_GEM_FOPS(drv_fops); + * * struct drm_driver drv = { * .driver_feature = DRM_ ... , - * .fops = &fops, + * .fops = &drv_fops, * DRM_GEM_VRAM_DRIVER * }; * @@ -71,7 +69,7 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs; * // setup device, vram base and size * // ... * - * ret = drmm_vram_helper_alloc_mm(dev, vram_base, vram_size); + * ret = drmm_vram_helper_init(dev, vram_base, vram_size); * if (ret) * return ret; * return 0; @@ -84,7 +82,7 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs; * to userspace. * * You don't have to clean up the instance of VRAM MM. - * drmm_vram_helper_alloc_mm() is a managed interface that installs a + * drmm_vram_helper_init() is a managed interface that installs a * clean-up handler to run during the DRM device's release. * * For drawing or scanout operations, rsp. buffer objects have to be pinned diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 1bba0a0ed3f9..44aaec083763 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -453,7 +453,7 @@ EXPORT_SYMBOL(ttm_pool_alloc); * @pool: Pool to give pages back to. * @tt: ttm_tt object to unpopulate * - * Give the packing pages back to a pool or free them + * Give the backing pages back to a pool or free them */ void ttm_pool_free(struct ttm_pool *pool, struct ttm_tt *tt) { diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h index 9923c7a6885e..2ea4b8692bd7 100644 --- a/include/drm/drm_device.h +++ b/include/drm/drm_device.h @@ -135,7 +135,9 @@ struct drm_device { /** * @struct_mutex: * - * Lock for others (not &drm_minor.master and &drm_file.is_master) + * Lock for others (not &drm_file.was_master, &drm_file.is_master, + * &drm_file.master, &drm_device.master, &drm_master.unique, + * &drm_master.unique_len and &drm_master.magic_map) * * WARNING: * Only drivers annotated with DRIVER_LEGACY should be using this. @@ -145,7 +147,9 @@ struct drm_device { /** * @master_mutex: * - * Lock for &drm_minor.master and &drm_file.is_master + * Lock for &drm_file.was_master, &drm_file.is_master, &drm_file.master, + * &drm_device.master, &drm_master.unique, &drm_master.unique_len and + * &drm_master.magic_map */ struct mutex master_mutex; diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index f6159acb8856..1a5463984334 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -46,7 +46,7 @@ struct sg_table; /** * enum drm_driver_feature - feature flags * - * See &drm_driver.driver_features, drm_device.driver_features and + * See &drm_driver.driver_features, &drm_device.driver_features and * drm_core_check_feature(). */ enum drm_driver_feature { @@ -229,8 +229,8 @@ struct drm_driver { * * All legacy drivers use this callback to de-initialize the hardware. * This is purely because of the shadow-attach model, where the DRM - * kernel driver does not really own the hardware. Instead ownershipe is - * handled with the help of userspace through an inheritedly racy dance + * kernel driver does not really own the hardware. Instead ownership is + * handled with the help of userspace through an inherited racy dance * to set/unset the VT into raw mode. * * Legacy drivers initialize the hardware in the @firstopen callback, diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h index fbda4ce5d5fb..d9a63d5d3851 100644 --- a/include/drm/drm_gem_cma_helper.h +++ b/include/drm/drm_gem_cma_helper.h @@ -160,7 +160,7 @@ drm_gem_cma_prime_import_sg_table(struct drm_device *dev, * &drm_driver structure. * * This macro is a variant of DRM_GEM_CMA_DRIVER_OPS for drivers that - * override the default implementation of &struct rm_driver.dumb_create. Use + * override the default implementation of &struct drm_driver.dumb_create. Use * DRM_GEM_CMA_DRIVER_OPS if possible. Drivers that require a virtual address * on imported buffers should use * DRM_GEM_CMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE() instead. diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index c083a1d71cf4..0565c2624b0a 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -46,7 +46,6 @@ struct vm_area_struct; * operations. So a buffer object that has been pinned N times with * drm_gem_vram_pin() must be unpinned N times with * drm_gem_vram_unpin(). The same applies to pairs of - * drm_gem_vram_kmap() and drm_gem_vram_kunmap(), as well as pairs of * drm_gem_vram_vmap() and drm_gem_vram_vunmap(). */ struct drm_gem_vram_object {