Re: [RFC PATCH v3 2/3] accel: add dedicated minor for accelerator devices

From: Jeffrey Hugo
Date: Mon Nov 07 2022 - 11:24:09 EST


On 11/6/2022 2:02 PM, Oded Gabbay wrote:
--- a/drivers/accel/drm_accel.c
+++ b/drivers/accel/drm_accel.c
@@ -8,14 +8,25 @@

#include <linux/debugfs.h>
#include <linux/device.h>
+#include <linux/xarray.h>

If we are not using xarray at this time, do we still need this include?


#include <drm/drm_accel.h>
+#include <drm/drm_debugfs.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_print.h>

+static DEFINE_SPINLOCK(accel_minor_lock);
+static struct idr accel_minors_idr;

I beleive we should have an explicit include for the IDR header.

--- a/include/drm/drm_accel.h
+++ b/include/drm/drm_accel.h
@@ -8,12 +8,56 @@
#ifndef DRM_ACCEL_H_
#define DRM_ACCEL_H_

-#define ACCEL_MAJOR 261
+#include <drm/drm_file.h>
+
+#define ACCEL_MAJOR 261
+#define ACCEL_MAX_MINORS 256

This diff seems really weird. The changes to the ACCEL_MAJOR define could get pushed to the previous patch, no?

@@ -23,9 +67,31 @@ static inline void accel_core_exit(void)

static inline int __init accel_core_init(void)
{
+ /* Return 0 to allow drm_core_init to complete successfully */

Move to previous patch?

--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -94,6 +94,14 @@ enum drm_driver_feature {
* synchronization of command submission.
*/
DRIVER_SYNCOBJ_TIMELINE = BIT(6),
+ /**
+ * @DRIVER_COMPUTE_ACCEL:
+ *
+ * Driver supports compute acceleration devices. This flag is mutually exclusive with
+ * @DRIVER_RENDER and @DRIVER_MODESET. Devices that support both graphics and compute
+ * acceleration should be handled by two drivers that are connected using auxiliry bus.

auxiliry -> auxiliary