Skip to contentSkip to conversation

drm_crtc.[hc] cleanup and documenation

PATCH In review Daniel Vetter 4 participants 29 messages Nov 14, 2016 – Nov 15, 2016

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover drm_crtc.[hc] cleanup and documenation

Hi all,

Final bits, finally, leaving really only CRTC related code and structures in drm_crtc.[hc].

I guess next up is a bit of polish for atomic code, that has grown a lot and I think it'd be useful to split at least the helpers a bit. And a recent discussion with Rob Clark showed me that we've entirely forgotten to document the global state subclassing stuff properly.

Cheers, Daniel

Daniel Vetter (10):
drm: Extract drm_dumb_buffers.c
drm/i915: Fixup kerneldoc includes
doc/dma-buf: Fix up include directives
drm: Extract drm_drv.h
drm: Clean up kerneldoc for struct drm_driver
drm: Consolidate dumb buffer docs
drm/print: Move kerneldoc next to definition
drm: Extract drm_mode_config.[hc]
drm: Move tile group code into drm_connector.c
drm: Drop externs from drm_crtc.h

 Documentation/driver-api/infrastructure.rst |   8 +-
 Documentation/gpu/drm-internals.rst         |   5 +-
 Documentation/gpu/drm-kms-helpers.rst       |   8 -
 Documentation/gpu/drm-kms.rst               |  80 ++--
 Documentation/gpu/i915.rst                  |   6 +-
 drivers/gpu/drm/Makefile                    |   3 +-
 drivers/gpu/drm/drm_connector.c             | 104 +++++
 drivers/gpu/drm/drm_crtc.c                  | 587 +------------------------
 drivers/gpu/drm/drm_crtc_internal.h         |  34 +-
 drivers/gpu/drm/drm_drv.c                   |  18 +-
 drivers/gpu/drm/drm_dumb_buffers.c          | 125 ++++++
 drivers/gpu/drm/drm_internal.h              |   4 +
 drivers/gpu/drm/drm_mode_config.c           | 399 +++++++++++++++++
 drivers/gpu/drm/drm_print.c                 |   5 +
 include/drm/drmP.h                          | 299 +------------
 include/drm/drm_connector.h                 |  24 +
 include/drm/drm_crtc.h                      | 651 +--------------------------
 include/drm/drm_drv.h                       | 427 ++++++++++++++++++
 include/drm/drm_mode_config.h               | 658 ++++++++++++++++++++++++++++
 include/drm/drm_print.h                     |   5 -
 include/linux/dma-fence.h                   |   2 +-
 21 files changed, 1824 insertions(+), 1628 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_dumb_buffers.c
 create mode 100644 drivers/gpu/drm/drm_mode_config.c
 create mode 100644 include/drm/drm_drv.h
 create mode 100644 include/drm/drm_mode_config.h
Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/10 drm: Extract drm_dumb_buffers.c

Just code movement, doc cleanup will follow up later.

---
 drivers/gpu/drm/Makefile            |   3 +-
 drivers/gpu/drm/drm_crtc.c          | 109 -----------------------------
 drivers/gpu/drm/drm_crtc_internal.h |  18 ++---
 drivers/gpu/drm/drm_dumb_buffers.c  | 135 ++++++++++++++++++++++++++++++++++++
 4 files changed, 147 insertions(+), 118 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_dumb_buffers.c
drivers/gpu/drm/Makefile +2 -1
index f217274754d4..adcfc8f922e3 100644
@@ -15,7 +15,8 @@ drm-y       :=	drm_auth.o drm_bufs.o drm_cache.o \
 		drm_modeset_lock.o drm_atomic.o drm_bridge.o \
 		drm_framebuffer.o drm_connector.o drm_blend.o \
 		drm_encoder.o drm_mode_object.o drm_property.o \
-		drm_plane.o drm_color_mgmt.o drm_print.o
+		drm_plane.o drm_color_mgmt.o drm_print.o \
+		drm_dumb_buffers.o
 
 drm-$(CONFIG_COMPAT) += drm_ioc32.o
 drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
drivers/gpu/drm/drm_crtc.c +0 -109

115 lines not on this page · raw message

drivers/gpu/drm/drm_crtc_internal.h +10 -8
index b076ef58635d..3d23a473ec35 100644
@@ -43,14 +43,6 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 
 void drm_fb_release(struct drm_file *file_priv);
 
-/* dumb buffer support IOCTLs */
-int drm_mode_create_dumb_ioctl(struct drm_device *dev,
-			       void *data, struct drm_file *file_priv);
-int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
-			     void *data, struct drm_file *file_priv);
-int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
-				void *data, struct drm_file *file_priv);
-
 /* IOCTLs */
 int drm_mode_getresources(struct drm_device *dev,
 			  void *data, struct drm_file *file_priv);
@@ -59,6 +51,16 @@ int drm_mode_getcrtc(struct drm_device *dev,
 int drm_mode_setcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 
+/* drm_dumb_buffers.c */
+
+/* IOCTLs */
+int drm_mode_create_dumb_ioctl(struct drm_device *dev,
+			       void *data, struct drm_file *file_priv);
+int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
+			     void *data, struct drm_file *file_priv);
+int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *file_priv);
+
 /* drm_color_mgmt.c */
 
 /* IOCTLs */
drivers/gpu/drm/drm_dumb_buffers.c new file +135 -0

135 lines not on this page · raw message

Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/10
#2 lore raw

Re: [PATCH 01/10] drm: Extract drm_dumb_buffers.c

Quoted 187 lines · Daniel Vetter

Just code movement, doc cleanup will follow up later.

---
 drivers/gpu/drm/Makefile            |   3 +-
 drivers/gpu/drm/drm_crtc.c          | 109 -----------------------------
 drivers/gpu/drm/drm_crtc_internal.h |  18 ++---
 drivers/gpu/drm/drm_dumb_buffers.c  | 135 ++++++++++++++++++++++++++++++++++++
 4 files changed, 147 insertions(+), 118 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_dumb_buffers.c
drivers/gpu/drm/Makefile +2 -1
index f217274754d4..adcfc8f922e3 100644
@@ -15,7 +15,8 @@ drm-y       :=	drm_auth.o drm_bufs.o drm_cache.o \
 		drm_modeset_lock.o drm_atomic.o drm_bridge.o \
 		drm_framebuffer.o drm_connector.o drm_blend.o \
 		drm_encoder.o drm_mode_object.o drm_property.o \
-		drm_plane.o drm_color_mgmt.o drm_print.o
+		drm_plane.o drm_color_mgmt.o drm_print.o \
+		drm_dumb_buffers.o
 
 drm-$(CONFIG_COMPAT) += drm_ioc32.o
 drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
drivers/gpu/drm/drm_crtc.c +0 -109
index 4f34d9a34190..0ece33cc0dc6 100644
@@ -960,115 +960,6 @@ void drm_mode_config_reset(struct drm_device *dev)
 EXPORT_SYMBOL(drm_mode_config_reset);
 
 /**
- * drm_mode_create_dumb_ioctl - create a dumb backing storage buffer
- * @dev: DRM device
- * @data: ioctl data
- * @file_priv: DRM file info
- *
- * This creates a new dumb buffer in the driver's backing storage manager (GEM,
- * TTM or something else entirely) and returns the resulting buffer handle. This
- * handle can then be wrapped up into a framebuffer modeset object.
- *
- * Note that userspace is not allowed to use such objects for render
- * acceleration - drivers must create their own private ioctls for such a use
- * case.
- *
- * Called by the user via ioctl.
- *
- * Returns:
- * Zero on success, negative errno on failure.
- */
-int drm_mode_create_dumb_ioctl(struct drm_device *dev,
-			       void *data, struct drm_file *file_priv)
-{
-	struct drm_mode_create_dumb *args = data;
-	u32 cpp, stride, size;
-
-	if (!dev->driver->dumb_create)
-		return -ENOSYS;
-	if (!args->width || !args->height || !args->bpp)
-		return -EINVAL;
-
-	/* overflow checks for 32bit size calculations */
-	/* NOTE: DIV_ROUND_UP() can overflow */
-	cpp = DIV_ROUND_UP(args->bpp, 8);
-	if (!cpp || cpp > 0xffffffffU / args->width)
-		return -EINVAL;
-	stride = cpp * args->width;
-	if (args->height > 0xffffffffU / stride)
-		return -EINVAL;
-
-	/* test for wrap-around */
-	size = args->height * stride;
-	if (PAGE_ALIGN(size) == 0)
-		return -EINVAL;
-
-	/*
-	 * handle, pitch and size are output parameters. Zero them out to
-	 * prevent drivers from accidentally using uninitialized data. Since
-	 * not all existing userspace is clearing these fields properly we
-	 * cannot reject IOCTL with garbage in them.
-	 */
-	args->handle = 0;
-	args->pitch = 0;
-	args->size = 0;
-
-	return dev->driver->dumb_create(file_priv, dev, args);
-}
-
-/**
- * drm_mode_mmap_dumb_ioctl - create an mmap offset for a dumb backing storage buffer
- * @dev: DRM device
- * @data: ioctl data
- * @file_priv: DRM file info
- *
- * Allocate an offset in the drm device node's address space to be able to
- * memory map a dumb buffer.
- *
- * Called by the user via ioctl.
- *
- * Returns:
- * Zero on success, negative errno on failure.
- */
-int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
-			     void *data, struct drm_file *file_priv)
-{
-	struct drm_mode_map_dumb *args = data;
-
-	/* call driver ioctl to get mmap offset */
-	if (!dev->driver->dumb_map_offset)
-		return -ENOSYS;
-
-	return dev->driver->dumb_map_offset(file_priv, dev, args->handle, &args->offset);
-}
-
-/**
- * drm_mode_destroy_dumb_ioctl - destroy a dumb backing strage buffer
- * @dev: DRM device
- * @data: ioctl data
- * @file_priv: DRM file info
- *
- * This destroys the userspace handle for the given dumb backing storage buffer.
- * Since buffer objects must be reference counted in the kernel a buffer object
- * won't be immediately freed if a framebuffer modeset object still uses it.
- *
- * Called by the user via ioctl.
- *
- * Returns:
- * Zero on success, negative errno on failure.
- */
-int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
-				void *data, struct drm_file *file_priv)
-{
-	struct drm_mode_destroy_dumb *args = data;
-
-	if (!dev->driver->dumb_destroy)
-		return -ENOSYS;
-
-	return dev->driver->dumb_destroy(file_priv, dev, args->handle);
-}
-
-/**
  * drm_mode_config_init - initialize DRM mode_configuration structure
  * @dev: DRM device
  *
drivers/gpu/drm/drm_crtc_internal.h +10 -8
index b076ef58635d..3d23a473ec35 100644
@@ -43,14 +43,6 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 
 void drm_fb_release(struct drm_file *file_priv);
 
-/* dumb buffer support IOCTLs */
-int drm_mode_create_dumb_ioctl(struct drm_device *dev,
-			       void *data, struct drm_file *file_priv);
-int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
-			     void *data, struct drm_file *file_priv);
-int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
-				void *data, struct drm_file *file_priv);
-
 /* IOCTLs */
 int drm_mode_getresources(struct drm_device *dev,
 			  void *data, struct drm_file *file_priv);
@@ -59,6 +51,16 @@ int drm_mode_getcrtc(struct drm_device *dev,
 int drm_mode_setcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 
+/* drm_dumb_buffers.c */
+
+/* IOCTLs */
+int drm_mode_create_dumb_ioctl(struct drm_device *dev,
+			       void *data, struct drm_file *file_priv);
+int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
+			     void *data, struct drm_file *file_priv);
+int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
+				void *data, struct drm_file *file_priv);
+
 /* drm_color_mgmt.c */
 
 /* IOCTLs */
drivers/gpu/drm/drm_dumb_buffers.c new file +0 -0
new file mode 100644
index 000000000000..4b4364b61c8d

drivers/gpu/drm/drm_dumb_buffers.c line 2

Quoted 2 lines
drivers/gpu/drm/drm_dumb_buffers.c new file +2 -0
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016 Intel Corporation

I've mentioned this elsewhere, but we should also retain the original copyright statements for the code we are copying.

Otherwise,

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH 01/10] drm: Extract drm_dumb_buffers.c

Quoted 12 lines · Chris Wilson

drivers/gpu/drm/drm_dumb_buffers.c line 2

Quoted 8 lines · Daniel Vetter
drivers/gpu/drm/drm_dumb_buffers.c new file +2 -0
new file mode 100644
index 000000000000..4b4364b61c8d
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016 Intel Corporation

I've mentioned this elsewhere, but we should also retain the original copyright statements for the code we are copying.

Given that we're super-not-dutiful with updating them I figured point at git log with rename detection is good enough. But fixed (same for the later ones).
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [Intel-gfx] [PATCH 01/10] drm: Extract drm_dumb_buffers.c

Quoted 14 lines · Daniel Vetter
Quoted 12 lines · Chris Wilson

drivers/gpu/drm/drm_dumb_buffers.c line 2

Quoted 8 lines · Daniel Vetter
drivers/gpu/drm/drm_dumb_buffers.c new file +2 -0
new file mode 100644
index 000000000000..4b4364b61c8d
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016 Intel Corporation

I've mentioned this elsewhere, but we should also retain the original copyright statements for the code we are copying.

Quoted 3 lines

Given that we're super-not-dutiful with updating them I figured point at git log with rename detection is good enough. But fixed (same for the later ones).

I agree that git gives more traceablity to authorship (if not necessarily to whom that author has transfered the copyright for the work), but I feel if we are adding a blanket copyright clause we should recognise the validity of the earlier ones as well.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 2/10 drm/i915: Fixup kerneldoc includes

In reply to Daniel Vetter

Would be great if everony could add

$ make DOCBOOKS="" htmldocs

to their build scripts to catch these. 0day should also report them, not sure why it failed to spot this.

Fixes b42fe9ca0a1e ("drm/i915: Split out i915_vma.c")
Cc Tvrtko Ursulin <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 Documentation/gpu/i915.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/gpu/i915.rst +3 -3
index ba83b7d88f1f..117d2ab7a5f7 100644
@@ -258,19 +258,19 @@ Global GTT views
 GTT Fences and Swizzling
 ------------------------
 
-.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence.c
+.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence_reg.c
    :internal:
 
 Global GTT Fence Handling
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 
-.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence.c
+.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence_reg.c
    :doc: fence register handling
 
 Hardware Tiling and Swizzling Details
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence.c
+.. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence_reg.c
    :doc: tiling swizzling details
 
 Object Tiling IOCTLs
Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/10
#6 lore raw

Re: [PATCH 02/10] drm/i915: Fixup kerneldoc includes

Quoted 1 line · Daniel Vetter

Would be great if everony could add

everyone

Quoted 4 lines
$ make DOCBOOKS="" htmldocs

to their build scripts to catch these. 0day should also report them, not sure why it failed to spot this.

"make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs" is that outdated?

I don't often run it since it is too slow when checking hundreds of patches. Any chance of an incremental patch checker?

Quoted 5 lines
Fixes b42fe9ca0a1e ("drm/i915: Split out i915_vma.c")
Cc Tvrtko Ursulin <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>

(I'm not even going to ask how it appears three times in the docs and how that all works :)
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

Re: [PATCH 02/10] drm/i915: Fixup kerneldoc includes

Quoted 11 lines · Chris Wilson
Quoted 1 line · Daniel Vetter

Would be great if everony could add

everyone

Quoted 4 lines
$ make DOCBOOKS="" htmldocs

to their build scripts to catch these. 0day should also report them, not sure why it failed to spot this.

"make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs" is that outdated?

IGNORE_DOCBOOKS=1 was renamed to DOCBOOKS="". And incremental builds (at least in my experience here) are really fast with sphinx (a few seconds at most). So should be good enough for a git rebase -x type checking.

Quoted 2 lines

I don't often run it since it is too slow when checking hundreds of patches. Any chance of an incremental patch checker?

As long as you make sure you entirely avoid the old docbook horror show, incremental builds should be real fast. The initial build can take a while, but again if you avoid docbook it's reasonable fast imo. Full kernel rebuilds are still much worse.

Quoted 9 lines
Quoted 5 lines
Fixes b42fe9ca0a1e ("drm/i915: Split out i915_vma.c")
Cc Tvrtko Ursulin <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>

(I'm not even going to ask how it appears three times in the docs and how that all works :)

The follow-up paramaters are crucial: First one pulls in function kernel-docs only, other 2 pull in specific DOC: comment sections. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

Re: [PATCH 02/10] drm/i915: Fixup kerneldoc includes

In reply to Chris Wilson
Quoted 11 lines · Chris Wilson
Quoted 1 line · Daniel Vetter

Would be great if everony could add

everyone

Quoted 4 lines
$ make DOCBOOKS="" htmldocs

to their build scripts to catch these. 0day should also report them, not sure why it failed to spot this.

"make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs" is that outdated?

IGNORE_DOCBOOKS=1 was renamed to DOCBOOKS="". And incremental builds (at least in my experience here) are really fast with sphinx (a few seconds at most). So should be good enough for a git rebase -x type checking.

Quoted 2 lines

I don't often run it since it is too slow when checking hundreds of patches. Any chance of an incremental patch checker?

As long as you make sure you entirely avoid the old docbook horror show, incremental builds should be real fast. The initial build can take a while, but again if you avoid docbook it's reasonable fast imo. Full kernel rebuilds are still much worse.
-Daniel

Quoted 17 lines
Quoted 5 lines
Fixes b42fe9ca0a1e ("drm/i915: Split out i915_vma.c")
Cc Tvrtko Ursulin <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>

(I'm not even going to ask how it appears three times in the docs and how that all works :)
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

PATCH 3/10 doc/dma-buf: Fix up include directives

In reply to Daniel Vetter

Would be great if everony could add

$ make DOCBOOKS="" htmldocs

to their build scripts to catch these. 0day should also report them, not sure why it failed to spot this.

Fixes f54d1867005c ("dma-buf: Rename struct fence to dma_fence")
Cc Chris Wilson <[email protected]>
Cc Gustavo Padovan <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Christian König <[email protected]>
---
 Documentation/driver-api/infrastructure.rst | 8 ++++----
 include/linux/dma-fence.h                   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
Documentation/driver-api/infrastructure.rst +4 -4
index 5d50d6733db3..a0d65eb49055 100644
@@ -86,10 +86,10 @@ reservation
 fence
 ~~~~~
 
-.. kernel-doc:: drivers/dma-buf/fence.c
+.. kernel-doc:: drivers/dma-buf/dma-fence.c
    :export:
 
-.. kernel-doc:: include/linux/fence.h
+.. kernel-doc:: include/linux/dma-fence.h
    :internal:
 
 .. kernel-doc:: drivers/dma-buf/seqno-fence.c
@@ -98,10 +98,10 @@ fence
 .. kernel-doc:: include/linux/seqno-fence.h
    :internal:
 
-.. kernel-doc:: drivers/dma-buf/fence-array.c
+.. kernel-doc:: drivers/dma-buf/dma-fence-array.c
    :export:
 
-.. kernel-doc:: include/linux/fence-array.h
+.. kernel-doc:: include/linux/dma-fence-array.h
    :internal:
 
 .. kernel-doc:: drivers/dma-buf/reservation.c
include/linux/dma-fence.h +1 -1
index fcf4b1971eba..d51a7d23c358 100644
@@ -225,7 +225,7 @@ static inline struct dma_fence *dma_fence_get_rcu(struct dma_fence *fence)
 
 /**
  * dma_fence_get_rcu_safe  - acquire a reference to an RCU tracked fence
- * @fence:	[in]	pointer to fence to increase refcount of
+ * @fencep:	[in]	pointer to fence to increase refcount of
  *
  * Function returns NULL if no refcount could be obtained, or the fence.
  * This function handles acquiring a reference to a fence that may be
Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

Re: [PATCH 03/10] doc/dma-buf: Fix up include directives

Quoted 7 lines · Daniel Vetter

Would be great if everony could add

$ make DOCBOOKS="" htmldocs

to their build scripts to catch these. 0day should also report them, not sure why it failed to spot this.

Quoted 6 lines
Fixes f54d1867005c ("dma-buf: Rename struct fence to dma_fence")
Cc Chris Wilson <[email protected]>
Cc Gustavo Padovan <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Christian König <[email protected]>

Weird, I caught some of the stale Documents/, obviously that didn't trigger a warning that I needed to do a more careful check.

Reviewed: Chris Wilson <[email protected]>
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH 4/10 drm: Extract drm_drv.h

In reply to Daniel Vetter

I want to move dumb buffer documentation into the right vfuncs, and for that I first need to be able to pull that into kerneldoc without having to clean up all of drmP.h. Also, header-splitting is nice.

While at it shuffle all the function declarations for drm_drv.c into the right spots, and drop the kerneldoc for drm_minor_acquire/release since it's only used internally.

---
 drivers/gpu/drm/drm_drv.c      |  18 +--
 drivers/gpu/drm/drm_internal.h |   4 +
 include/drm/drmP.h             | 299 +-----------------------------------
 include/drm/drm_drv.h          | 337 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 346 insertions(+), 312 deletions(-)
 create mode 100644 include/drm/drm_drv.h
drivers/gpu/drm/drm_drv.c +4 -14
index 98a083d4b81e..cc6c2530764b 100644
@@ -32,7 +32,10 @@
 #include <linux/moduleparam.h>
 #include <linux/mount.h>
 #include <linux/slab.h>
+
+#include <drm/drm_drv.h>
 #include <drm/drmP.h>
+
 #include "drm_crtc_internal.h"
 #include "drm_legacy.h"
 #include "drm_internal.h"
@@ -257,10 +260,7 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
 	drm_debugfs_cleanup(minor);
 }
 
-/**
- * drm_minor_acquire - Acquire a DRM minor
- * @minor_id: Minor ID of the DRM-minor
- *
+/*
  * Looks up the given minor-ID and returns the respective DRM-minor object. The
  * refence-count of the underlying device is increased so you must release this
  * object with drm_minor_release().
@@ -268,10 +268,6 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
  * As long as you hold this minor, it is guaranteed that the object and the
  * minor->dev pointer will stay valid! However, the device may get unplugged and
  * unregistered while you hold the minor.
- *
- * Returns:
- * Pointer to minor-object with increased device-refcount, or PTR_ERR on
- * failure.
  */
 struct drm_minor *drm_minor_acquire(unsigned int minor_id)
 {
@@ -294,12 +290,6 @@ struct drm_minor *drm_minor_acquire(unsigned int minor_id)
 	return minor;
 }
 
-/**
- * drm_minor_release - Release DRM minor
- * @minor: Pointer to DRM minor object
- *
- * Release a minor that was previously acquired via drm_minor_acquire().
- */
 void drm_minor_release(struct drm_minor *minor)
 {
 	drm_dev_unref(minor->dev);
drivers/gpu/drm/drm_internal.h +4 -0
index 1e29cbc556d5..db80ec860e33 100644
@@ -43,6 +43,10 @@ void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
 void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv,
 					struct dma_buf *dma_buf);
 
+/* drm_drv.c */
+struct drm_minor *drm_minor_acquire(unsigned int minor_id);
+void drm_minor_release(struct drm_minor *minor);
+
 /* drm_info.c */
 int drm_name_info(struct seq_file *m, void *data);
 int drm_clients_info(struct seq_file *m, void* data);
include/drm/drmP.h +1 -298

333 lines not on this page · raw message

include/drm/drm_drv.h new file +337 -0

337 lines not on this page · raw message

Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 4/10
#12 lore raw

Re: [Intel-gfx] [PATCH 04/10] drm: Extract drm_drv.h

Quoted 431 lines · Daniel Vetter

I want to move dumb buffer documentation into the right vfuncs, and for that I first need to be able to pull that into kerneldoc without having to clean up all of drmP.h. Also, header-splitting is nice.

While at it shuffle all the function declarations for drm_drv.c into the right spots, and drop the kerneldoc for drm_minor_acquire/release since it's only used internally.

---
 drivers/gpu/drm/drm_drv.c      |  18 +--
 drivers/gpu/drm/drm_internal.h |   4 +
 include/drm/drmP.h             | 299 +-----------------------------------
 include/drm/drm_drv.h          | 337 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 346 insertions(+), 312 deletions(-)
 create mode 100644 include/drm/drm_drv.h
drivers/gpu/drm/drm_drv.c +4 -14
index 98a083d4b81e..cc6c2530764b 100644
@@ -32,7 +32,10 @@
 #include <linux/moduleparam.h>
 #include <linux/mount.h>
 #include <linux/slab.h>
+
+#include <drm/drm_drv.h>
 #include <drm/drmP.h>
+
 #include "drm_crtc_internal.h"
 #include "drm_legacy.h"
 #include "drm_internal.h"
@@ -257,10 +260,7 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
 	drm_debugfs_cleanup(minor);
 }
 
-/**
- * drm_minor_acquire - Acquire a DRM minor
- * @minor_id: Minor ID of the DRM-minor
- *
+/*
  * Looks up the given minor-ID and returns the respective DRM-minor object. The
  * refence-count of the underlying device is increased so you must release this
  * object with drm_minor_release().
@@ -268,10 +268,6 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
  * As long as you hold this minor, it is guaranteed that the object and the
  * minor->dev pointer will stay valid! However, the device may get unplugged and
  * unregistered while you hold the minor.
- *
- * Returns:
- * Pointer to minor-object with increased device-refcount, or PTR_ERR on
- * failure.
  */
 struct drm_minor *drm_minor_acquire(unsigned int minor_id)
 {
@@ -294,12 +290,6 @@ struct drm_minor *drm_minor_acquire(unsigned int minor_id)
 	return minor;
 }
 
-/**
- * drm_minor_release - Release DRM minor
- * @minor: Pointer to DRM minor object
- *
- * Release a minor that was previously acquired via drm_minor_acquire().
- */
 void drm_minor_release(struct drm_minor *minor)
 {
 	drm_dev_unref(minor->dev);
drivers/gpu/drm/drm_internal.h +4 -0
index 1e29cbc556d5..db80ec860e33 100644
@@ -43,6 +43,10 @@ void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
 void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv,
 					struct dma_buf *dma_buf);
 
+/* drm_drv.c */
+struct drm_minor *drm_minor_acquire(unsigned int minor_id);
+void drm_minor_release(struct drm_minor *minor);
+
 /* drm_info.c */
 int drm_name_info(struct seq_file *m, void *data);
 int drm_clients_info(struct seq_file *m, void* data);
include/drm/drmP.h +1 -298
index cfa4b80f0628..b352a7b812e6 100644
@@ -76,6 +76,7 @@
 #include <drm/drm_os_linux.h>
 #include <drm/drm_sarea.h>
 #include <drm/drm_vma_manager.h>
+#include <drm/drm_drv.h>
 
 struct module;
 
@@ -137,34 +138,10 @@ struct dma_buf_attachment;
 #define DRM_UT_VBL		0x20
 #define DRM_UT_STATE		0x40
 
-extern __printf(6, 7)
-void drm_dev_printk(const struct device *dev, const char *level,
-		    unsigned int category, const char *function_name,
-		    const char *prefix, const char *format, ...);
-
-extern __printf(3, 4)
-void drm_printk(const char *level, unsigned int category,
-		const char *format, ...);
-
 /***********************************************************************/
 /** \name DRM template customization defaults */
 /*@{*/
 
-/* driver capabilities and requirements mask */
-#define DRIVER_USE_AGP			0x1
-#define DRIVER_LEGACY			0x2
-#define DRIVER_PCI_DMA			0x8
-#define DRIVER_SG			0x10
-#define DRIVER_HAVE_DMA			0x20
-#define DRIVER_HAVE_IRQ			0x40
-#define DRIVER_IRQ_SHARED		0x80
-#define DRIVER_GEM			0x1000
-#define DRIVER_MODESET			0x2000
-#define DRIVER_PRIME			0x4000
-#define DRIVER_RENDER			0x8000
-#define DRIVER_ATOMIC			0x10000
-#define DRIVER_KMS_LEGACY_CONTEXT	0x20000
-
 /***********************************************************************/
 /** \name Macros to make printk easier */
 /*@{*/
@@ -480,263 +457,6 @@ struct drm_lock_data {
 #define DRM_SCANOUTPOS_IN_VBLANK    (1 << 1)
 #define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
 
-/**
- * DRM driver structure. This structure represent the common code for
- * a family of cards. There will one drm_device for each card present
- * in this family
- */
-struct drm_driver {
-	int (*load) (struct drm_device *, unsigned long flags);
-	int (*firstopen) (struct drm_device *);
-	int (*open) (struct drm_device *, struct drm_file *);
-	void (*preclose) (struct drm_device *, struct drm_file *file_priv);
-	void (*postclose) (struct drm_device *, struct drm_file *);
-	void (*lastclose) (struct drm_device *);
-	int (*unload) (struct drm_device *);
-	int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
-	int (*dma_quiescent) (struct drm_device *);
-	int (*context_dtor) (struct drm_device *dev, int context);
-	int (*set_busid)(struct drm_device *dev, struct drm_master *master);
-
-	/**
-	 * get_vblank_counter - get raw hardware vblank counter
-	 * @dev: DRM device
-	 * @pipe: counter to fetch
-	 *
-	 * Driver callback for fetching a raw hardware vblank counter for @crtc.
-	 * If a device doesn't have a hardware counter, the driver can simply
-	 * use drm_vblank_no_hw_counter() function. The DRM core will account for
-	 * missed vblank events while interrupts where disabled based on system
-	 * timestamps.
-	 *
-	 * Wraparound handling and loss of events due to modesetting is dealt
-	 * with in the DRM core code.
-	 *
-	 * RETURNS
-	 * Raw vblank counter value.
-	 */
-	u32 (*get_vblank_counter) (struct drm_device *dev, unsigned int pipe);
-
-	/**
-	 * enable_vblank - enable vblank interrupt events
-	 * @dev: DRM device
-	 * @pipe: which irq to enable
-	 *
-	 * Enable vblank interrupts for @crtc.  If the device doesn't have
-	 * a hardware vblank counter, the driver should use the
-	 * drm_vblank_no_hw_counter() function that keeps a virtual counter.
-	 *
-	 * RETURNS
-	 * Zero on success, appropriate errno if the given @crtc's vblank
-	 * interrupt cannot be enabled.
-	 */
-	int (*enable_vblank) (struct drm_device *dev, unsigned int pipe);
-
-	/**
-	 * disable_vblank - disable vblank interrupt events
-	 * @dev: DRM device
-	 * @pipe: which irq to enable
-	 *
-	 * Disable vblank interrupts for @crtc.  If the device doesn't have
-	 * a hardware vblank counter, the driver should use the
-	 * drm_vblank_no_hw_counter() function that keeps a virtual counter.
-	 */
-	void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
-
-	/**
-	 * Called by \c drm_device_is_agp.  Typically used to determine if a
-	 * card is really attached to AGP or not.
-	 *
-	 * \param dev  DRM device handle
-	 *
-	 * \returns
-	 * One of three values is returned depending on whether or not the
-	 * card is absolutely \b not AGP (return of 0), absolutely \b is AGP
-	 * (return of 1), or may or may not be AGP (return of 2).
-	 */
-	int (*device_is_agp) (struct drm_device *dev);
-
-	/**
-	 * Called by vblank timestamping code.
-	 *
-	 * Return the current display scanout position from a crtc, and an
-	 * optional accurate ktime_get timestamp of when position was measured.
-	 *
-	 * \param dev  DRM device.
-	 * \param pipe Id of the crtc to query.
-	 * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0).
-	 * \param *vpos Target location for current vertical scanout position.
-	 * \param *hpos Target location for current horizontal scanout position.
-	 * \param *stime Target location for timestamp taken immediately before
-	 *               scanout position query. Can be NULL to skip timestamp.
-	 * \param *etime Target location for timestamp taken immediately after
-	 *               scanout position query. Can be NULL to skip timestamp.
-	 * \param mode Current display timings.
-	 *
-	 * Returns vpos as a positive number while in active scanout area.
-	 * Returns vpos as a negative number inside vblank, counting the number
-	 * of scanlines to go until end of vblank, e.g., -1 means "one scanline
-	 * until start of active scanout / end of vblank."
-	 *
-	 * \return Flags, or'ed together as follows:
-	 *
-	 * DRM_SCANOUTPOS_VALID = Query successful.
-	 * DRM_SCANOUTPOS_INVBL = Inside vblank.
-	 * DRM_SCANOUTPOS_ACCURATE = Returned position is accurate. A lack of
-	 * this flag means that returned position may be offset by a constant
-	 * but unknown small number of scanlines wrt. real scanout position.
-	 *
-	 */
-	int (*get_scanout_position) (struct drm_device *dev, unsigned int pipe,
-				     unsigned int flags, int *vpos, int *hpos,
-				     ktime_t *stime, ktime_t *etime,
-				     const struct drm_display_mode *mode);
-
-	/**
-	 * Called by \c drm_get_last_vbltimestamp. Should return a precise
-	 * timestamp when the most recent VBLANK interval ended or will end.
-	 *
-	 * Specifically, the timestamp in @vblank_time should correspond as
-	 * closely as possible to the time when the first video scanline of
-	 * the video frame after the end of VBLANK will start scanning out,
-	 * the time immediately after end of the VBLANK interval. If the
-	 * @crtc is currently inside VBLANK, this will be a time in the future.
-	 * If the @crtc is currently scanning out a frame, this will be the
-	 * past start time of the current scanout. This is meant to adhere
-	 * to the OpenML OML_sync_control extension specification.
-	 *
-	 * \param dev dev DRM device handle.
-	 * \param pipe crtc for which timestamp should be returned.
-	 * \param *max_error Maximum allowable timestamp error in nanoseconds.
-	 *                   Implementation should strive to provide timestamp
-	 *                   with an error of at most *max_error nanoseconds.
-	 *                   Returns true upper bound on error for timestamp.
-	 * \param *vblank_time Target location for returned vblank timestamp.
-	 * \param flags 0 = Defaults, no special treatment needed.
-	 * \param       DRM_CALLED_FROM_VBLIRQ = Function is called from vblank
-	 *	        irq handler. Some drivers need to apply some workarounds
-	 *              for gpu-specific vblank irq quirks if flag is set.
-	 *
-	 * \returns
-	 * Zero if timestamping isn't supported in current display mode or a
-	 * negative number on failure. A positive status code on success,
-	 * which describes how the vblank_time timestamp was computed.
-	 */
-	int (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe,
-				     int *max_error,
-				     struct timeval *vblank_time,
-				     unsigned flags);
-
-	/* these have to be filled in */
-
-	irqreturn_t(*irq_handler) (int irq, void *arg);
-	void (*irq_preinstall) (struct drm_device *dev);
-	int (*irq_postinstall) (struct drm_device *dev);
-	void (*irq_uninstall) (struct drm_device *dev);
-
-	/* Master routines */
-	int (*master_create)(struct drm_device *dev, struct drm_master *master);
-	void (*master_destroy)(struct drm_device *dev, struct drm_master *master);
-	/**
-	 * master_set is called whenever the minor master is set.
-	 * master_drop is called whenever the minor master is dropped.
-	 */
-
-	int (*master_set)(struct drm_device *dev, struct drm_file *file_priv,
-			  bool from_open);
-	void (*master_drop)(struct drm_device *dev, struct drm_file *file_priv);
-
-	int (*debugfs_init)(struct drm_minor *minor);
-	void (*debugfs_cleanup)(struct drm_minor *minor);
-
-	/**
-	 * @gem_free_object: deconstructor for drm_gem_objects
-	 *
-	 * This is deprecated and should not be used by new drivers. Use
-	 * @gem_free_object_unlocked instead.
-	 */
-	void (*gem_free_object) (struct drm_gem_object *obj);
-
-	/**
-	 * @gem_free_object_unlocked: deconstructor for drm_gem_objects
-	 *
-	 * This is for drivers which are not encumbered with dev->struct_mutex
-	 * legacy locking schemes. Use this hook instead of @gem_free_object.
-	 */
-	void (*gem_free_object_unlocked) (struct drm_gem_object *obj);
-
-	int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
-	void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
-
-	/**
-	 * Hook for allocating the GEM object struct, for use by core
-	 * helpers.
-	 */
-	struct drm_gem_object *(*gem_create_object)(struct drm_device *dev,
-						    size_t size);
-
-	/* prime: */
-	/* export handle -> fd (see drm_gem_prime_handle_to_fd() helper) */
-	int (*prime_handle_to_fd)(struct drm_device *dev, struct drm_file *file_priv,
-				uint32_t handle, uint32_t flags, int *prime_fd);
-	/* import fd -> handle (see drm_gem_prime_fd_to_handle() helper) */
-	int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv,
-				int prime_fd, uint32_t *handle);
-	/* export GEM -> dmabuf */
-	struct dma_buf * (*gem_prime_export)(struct drm_device *dev,
-				struct drm_gem_object *obj, int flags);
-	/* import dmabuf -> GEM */
-	struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev,
-				struct dma_buf *dma_buf);
-	/* low-level interface used by drm_gem_prime_{import,export} */
-	int (*gem_prime_pin)(struct drm_gem_object *obj);
-	void (*gem_prime_unpin)(struct drm_gem_object *obj);
-	struct reservation_object * (*gem_prime_res_obj)(
-				struct drm_gem_object *obj);
-	struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj);
-	struct drm_gem_object *(*gem_prime_import_sg_table)(
-				struct drm_device *dev,
-				struct dma_buf_attachment *attach,
-				struct sg_table *sgt);
-	void *(*gem_prime_vmap)(struct drm_gem_object *obj);
-	void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr);
-	int (*gem_prime_mmap)(struct drm_gem_object *obj,
-				struct vm_area_struct *vma);
-
-	/* vga arb irq handler */
-	void (*vgaarb_irq)(struct drm_device *dev, bool state);
-
-	/* dumb alloc support */
-	int (*dumb_create)(struct drm_file *file_priv,
-			   struct drm_device *dev,
-			   struct drm_mode_create_dumb *args);
-	int (*dumb_map_offset)(struct drm_file *file_priv,
-			       struct drm_device *dev, uint32_t handle,
-			       uint64_t *offset);
-	int (*dumb_destroy)(struct drm_file *file_priv,
-			    struct drm_device *dev,
-			    uint32_t handle);
-
-	/* Driver private ops for this object */
-	const struct vm_operations_struct *gem_vm_ops;
-
-	int major;
-	int minor;
-	int patchlevel;
-	char *name;
-	char *desc;
-	char *date;
-
-	u32 driver_features;
-	int dev_priv_size;
-	const struct drm_ioctl_desc *ioctls;
-	int num_ioctls;
-	const struct file_operations *fops;
-
-	/* List of devices hanging off this driver with stealth attach. */
-	struct list_head legacy_dev_list;
-};
-
 enum drm_minor_type {
 	DRM_MINOR_PRIMARY,
 	DRM_MINOR_CONTROL,
@@ -1007,11 +727,6 @@ void drm_clflush_virt_range(void *addr, unsigned long length);
  * DMA quiscent + idle. DMA quiescent usually requires the hardware lock.
  */
 
-/* drm_drv.c */
-void drm_put_dev(struct drm_device *dev);
-void drm_unplug_dev(struct drm_device *dev);
-extern unsigned int drm_debug;
-
 				/* Debugfs support */
 #if defined(CONFIG_DEBUG_FS)
 extern int drm_debugfs_create_files(const struct drm_info_list *files,
@@ -1064,18 +779,6 @@ extern void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
 extern void drm_sysfs_hotplug_event(struct drm_device *dev);
 
 
-struct drm_device *drm_dev_alloc(struct drm_driver *driver,
-				 struct device *parent);
-int drm_dev_init(struct drm_device *dev,
-		 struct drm_driver *driver,
-		 struct device *parent);
-void drm_dev_ref(struct drm_device *dev);
-void drm_dev_unref(struct drm_device *dev);
-int drm_dev_register(struct drm_device *dev, unsigned long flags);
-void drm_dev_unregister(struct drm_device *dev);
-
-struct drm_minor *drm_minor_acquire(unsigned int minor_id);
-void drm_minor_release(struct drm_minor *minor);
 
 /*@}*/
 
include/drm/drm_drv.h new file +0 -0
new file mode 100644
index 000000000000..98f930a76e6d

include/drm/drm_drv.h line 2

Quoted 2 lines
include/drm/drm_drv.h new file +2 -0
@@ -0,0 +1,337 @@
+/*
+ * Copyright 2016 Intel Corp.

Careful, it's a mix of some new and lots old. To be on the safe side, it should retain all the copyright statements of the original.

Otherwise, pretty sure it was mechanical,

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

PATCH 5/10 drm: Clean up kerneldoc for struct drm_driver

In reply to Daniel Vetter

Just cleans up what's there, still plenty missing.

---
 Documentation/gpu/drm-internals.rst |   3 +
 include/drm/drm_drv.h               | 168 +++++++++++++++++++++++-------------
 2 files changed, 109 insertions(+), 62 deletions(-)
Documentation/gpu/drm-internals.rst +3 -0
index 25ee92c5df65..a54ac97510b3 100644
@@ -143,6 +143,9 @@ Device Instance and Driver Handling
 .. kernel-doc:: drivers/gpu/drm/drm_drv.c
    :export:
 
+.. kernel-doc:: include/drm/drm_drv.h
+   :internal:
+
 Driver Load
 -----------
 
include/drm/drm_drv.h +106 -62

240 lines not on this page · raw message

Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 5/10
#14 lore raw

Re: [Intel-gfx] [PATCH 05/10] drm: Clean up kerneldoc for struct drm_driver

Quoted 3 lines · Daniel Vetter

Just cleans up what's there, still plenty missing.

I read it, seems to match my limited understanding of kerneldoc.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#15 lore raw

PATCH 6/10 drm: Consolidate dumb buffer docs

In reply to Daniel Vetter

Put the callback docs into struct drm_driver, and the small overview into a DOC comment.

---
 Documentation/gpu/drm-kms.rst      | 42 ++-------------------------------
 drivers/gpu/drm/drm_dumb_buffers.c | 46 ++++++++++++++----------------------
 include/drm/drm_drv.h              | 48 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 67 insertions(+), 69 deletions(-)
Documentation/gpu/drm-kms.rst +2 -40
index cb0d3537b705..4edfb6d91250 100644
@@ -72,46 +72,8 @@ DRM Format Handling
 Dumb Buffer Objects
 ===================
 
-The KMS API doesn't standardize backing storage object creation and
-leaves it to driver-specific ioctls. Furthermore actually creating a
-buffer object even for GEM-based drivers is done through a
-driver-specific ioctl - GEM only has a common userspace interface for
-sharing and destroying objects. While not an issue for full-fledged
-graphics stacks that include device-specific userspace components (in
-libdrm for instance), this limit makes DRM-based early boot graphics
-unnecessarily complex.
-
-Dumb objects partly alleviate the problem by providing a standard API to
-create dumb buffers suitable for scanout, which can then be used to
-create KMS frame buffers.
-
-To support dumb objects drivers must implement the dumb_create,
-dumb_destroy and dumb_map_offset operations.
-
--  int (\*dumb_create)(struct drm_file \*file_priv, struct
-   drm_device \*dev, struct drm_mode_create_dumb \*args);
-   The dumb_create operation creates a driver object (GEM or TTM
-   handle) suitable for scanout based on the width, height and depth
-   from the struct :c:type:`struct drm_mode_create_dumb
-   <drm_mode_create_dumb>` argument. It fills the argument's
-   handle, pitch and size fields with a handle for the newly created
-   object and its line pitch and size in bytes.
-
--  int (\*dumb_destroy)(struct drm_file \*file_priv, struct
-   drm_device \*dev, uint32_t handle);
-   The dumb_destroy operation destroys a dumb object created by
-   dumb_create.
-
--  int (\*dumb_map_offset)(struct drm_file \*file_priv, struct
-   drm_device \*dev, uint32_t handle, uint64_t \*offset);
-   The dumb_map_offset operation associates an mmap fake offset with
-   the object given by the handle and returns it. Drivers must use the
-   :c:func:`drm_gem_create_mmap_offset()` function to associate
-   the fake offset as described in ?.
-
-Note that dumb objects may not be used for gpu acceleration, as has been
-attempted on some ARM embedded platforms. Such drivers really must have
-a hardware-specific ioctl to allocate suitable buffer objects.
+.. kernel-doc:: drivers/gpu/drm/drm_dumb_buffers.c
+   :doc: overview
 
 Plane Abstraction
 =================
drivers/gpu/drm/drm_dumb_buffers.c +18 -28

63 lines not on this page · raw message

include/drm/drm_drv.h +47 -1

60 lines not on this page · raw message

Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 6/10
#16 lore raw

Re: [Intel-gfx] [PATCH 06/10] drm: Consolidate dumb buffer docs

Quoted 4 lines · Daniel Vetter

Put the callback docs into struct drm_driver, and the small overview into a DOC comment.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#17 lore raw

PATCH 7/10 drm/print: Move kerneldoc next to definition

In reply to Daniel Vetter

kerneldoc expects the comment next to definitions, otherwise it can't pick up exported vs. internal stuff.

This fixes a warning from the doc build done with:

$ make DOCBOOKS="" htmldocs
Fixes d8187177b0b1 ("drm: add helper for printing to log or seq_file")
Cc Rob Clark <[email protected]>
Cc Sean Paul <[email protected]>
---
 Documentation/gpu/drm-internals.rst | 2 +-
 drivers/gpu/drm/drm_print.c         | 5 +++++
 include/drm/drm_print.h             | 5 -----
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/gpu/drm-internals.rst +1 -1
index a54ac97510b3..e35920db1f4c 100644
@@ -366,7 +366,7 @@ Printer
 .. kernel-doc:: include/drm/drm_print.h
    :internal:
 
-.. kernel-doc:: include/drm/drm_print.h
+.. kernel-doc:: drivers/gpu/drm/drm_print.c
    :export:
 
 
drivers/gpu/drm/drm_print.c +5 -0
index 34eb85618b76..ad3caaa1f48b 100644
@@ -40,6 +40,11 @@ void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf)
 }
 EXPORT_SYMBOL(__drm_printfn_info);
 
+/**
+ * drm_printf - print to a &drm_printer stream
+ * @p: the &drm_printer
+ * @f: format string
+ */
 void drm_printf(struct drm_printer *p, const char *f, ...)
 {
 	struct va_format vaf;
include/drm/drm_print.h +0 -5
index 475ffe3730e9..1adf84aea622 100644
@@ -74,11 +74,6 @@ struct drm_printer {
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
 
-/**
- * drm_printf - print to a &drm_printer stream
- * @p: the &drm_printer
- * @f: format string
- */
 void drm_printf(struct drm_printer *p, const char *f, ...);
 
 
Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 7/10
#18 lore raw

Re: [Intel-gfx] [PATCH 07/10] drm/print: Move kerneldoc next to definition

Quoted 11 lines · Daniel Vetter

kerneldoc expects the comment next to definitions, otherwise it can't pick up exported vs. internal stuff.

This fixes a warning from the doc build done with:

$ make DOCBOOKS="" htmldocs
Fixes d8187177b0b1 ("drm: add helper for printing to log or seq_file")
Cc Rob Clark <[email protected]>
Cc Sean Paul <[email protected]>

Oh well, I liked the practice of having interface descriptions in the headers. If they are in the body, I may as well just read the code.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#19 lore raw

Re: [PATCH 07/10] drm/print: Move kerneldoc next to definition

Quoted 8 lines · Chris Wilson
Quoted 7 lines · Daniel Vetter

kerneldoc expects the comment next to definitions, otherwise it can't pick up exported vs. internal stuff.

This fixes a warning from the doc build done with:

$ make DOCBOOKS="" htmldocs
Quoted 7 lines
Quoted 4 lines
Fixes d8187177b0b1 ("drm: add helper for printing to log or seq_file")
Cc Rob Clark <[email protected]>
Cc Sean Paul <[email protected]>

Oh well, I liked the practice of having interface descriptions in the headers. If they are in the body, I may as well just read the code.

I'm divided. On one hand it makes it more easily readable for users of the code&functions. Otoh having it closer might increase the odds that it's not forgotten when the semantics change. Personally I just have lots of windows open, with both code and rendered docs ...
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

Re: [Intel-gfx] [PATCH 07/10] drm/print: Move kerneldoc next to definition

Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Chris Wilson
Quoted 11 lines · Daniel Vetter

kerneldoc expects the comment next to definitions, otherwise it can't pick up exported vs. internal stuff.

This fixes a warning from the doc build done with:

$ make DOCBOOKS="" htmldocs
Fixes d8187177b0b1 ("drm: add helper for printing to log or seq_file")
Cc Rob Clark <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 7 lines
Quoted 2 lines

Oh well, I liked the practice of having interface descriptions in the headers. If they are in the body, I may as well just read the code.

I'm divided. On one hand it makes it more easily readable for users of the code&functions. Otoh having it closer might increase the odds that it's not forgotten when the semantics change. Personally I just have lots of windows open, with both code and rendered docs ...

And merged up to this one, with addressing your feedback re copyright notices. Somehow there's a nasty conflict with the extraction in patch 8 that I haven't figured out yet, needs more coffee. Thanks for your review. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#21 lore raw

PATCH 8/10 drm: Extract drm_mode_config.[hc]

In reply to Daniel Vetter

And shuffle the kernel-doc structure a bit since drm_crtc.[hc] now only contains CRTC-related functions and structures.

---
 Documentation/gpu/drm-kms.rst       |  32 +-
 drivers/gpu/drm/Makefile            |   2 +-
 drivers/gpu/drm/drm_crtc.c          | 379 +--------------------
 drivers/gpu/drm/drm_crtc_internal.h |  20 +-
 drivers/gpu/drm/drm_mode_config.c   | 399 ++++++++++++++++++++++
 include/drm/drm_crtc.h              | 622 +---------------------------------
 include/drm/drm_mode_config.h       | 658 ++++++++++++++++++++++++++++++++++++
 7 files changed, 1094 insertions(+), 1018 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_mode_config.c
 create mode 100644 include/drm/drm_mode_config.h
Documentation/gpu/drm-kms.rst +20 -12
index 4edfb6d91250..a8ff2c87c0e9 100644
@@ -15,25 +15,24 @@ be setup by initializing the following fields.
 -  struct drm_mode_config_funcs \*funcs;
    Mode setting functions.
 
-Modeset Base Object Abstraction
-===============================
+Mode Configuration
 
-.. kernel-doc:: include/drm/drm_mode_object.h
-   :internal:
+KMS Core Structures and Functions
+=================================
 
-.. kernel-doc:: drivers/gpu/drm/drm_mode_object.c
+.. kernel-doc:: drivers/gpu/drm/drm_mode_config.c
    :export:
 
-KMS Data Structures
-===================
-
-.. kernel-doc:: include/drm/drm_crtc.h
+.. kernel-doc:: include/drm/drm_mode_config.h
    :internal:
 
-KMS API Functions
-=================
+Modeset Base Object Abstraction
+===============================
 
-.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
+.. kernel-doc:: include/drm/drm_mode_object.h
+   :internal:
+
+.. kernel-doc:: drivers/gpu/drm/drm_mode_object.c
    :export:
 
 Atomic Mode Setting Function Reference
@@ -45,6 +44,15 @@ Atomic Mode Setting Function Reference
 .. kernel-doc:: include/drm/drm_atomic.h
    :internal:
 
+CRTC Abstraction
+================
+
+.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
+   :export:
+
+.. kernel-doc:: include/drm/drm_crtc.h
+   :internal:
+
 Frame Buffer Abstraction
 ========================
 
drivers/gpu/drm/Makefile +1 -1
index adcfc8f922e3..883f3e75cfbc 100644
@@ -16,7 +16,7 @@ drm-y       :=	drm_auth.o drm_bufs.o drm_cache.o \
 		drm_framebuffer.o drm_connector.o drm_blend.o \
 		drm_encoder.o drm_mode_object.o drm_property.o \
 		drm_plane.o drm_color_mgmt.o drm_print.o \
-		drm_dumb_buffers.o
+		drm_dumb_buffers.o drm_mode_config.o
 
 drm-$(CONFIG_COMPAT) += drm_ioc32.o
 drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
drivers/gpu/drm/drm_crtc.c +2 -377

409 lines not on this page · raw message

drivers/gpu/drm/drm_crtc_internal.h +13 -7
index 3d23a473ec35..dad212140d56 100644
@@ -40,18 +40,25 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 			    int x, int y,
 			    const struct drm_display_mode *mode,
 			    const struct drm_framebuffer *fb);
-
-void drm_fb_release(struct drm_file *file_priv);
+int drm_crtc_register_all(struct drm_device *dev);
+void drm_crtc_unregister_all(struct drm_device *dev);
 
 /* IOCTLs */
-int drm_mode_getresources(struct drm_device *dev,
-			  void *data, struct drm_file *file_priv);
 int drm_mode_getcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 int drm_mode_setcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 
+
+/* drm_mode_config.c */
+/* IOCTLs */
+int drm_mode_getresources(struct drm_device *dev,
+			  void *data, struct drm_file *file_priv);
+
+
 /* drm_dumb_buffers.c */
+int drm_modeset_register_all(struct drm_device *dev);
+void drm_modeset_unregister_all(struct drm_device *dev);
 
 /* IOCTLs */
 int drm_mode_create_dumb_ioctl(struct drm_device *dev,
@@ -150,6 +157,8 @@ void drm_framebuffer_free(struct kref *kref);
 int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
 				     uint32_t src_w, uint32_t src_h,
 				     const struct drm_framebuffer *fb);
+void drm_fb_release(struct drm_file *file_priv);
+
 
 /* IOCTL */
 int drm_mode_addfb(struct drm_device *dev,
@@ -170,9 +179,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
 			  void *data, struct drm_file *file_priv);
 int drm_atomic_remove_fb(struct drm_framebuffer *fb);
 
-int drm_modeset_register_all(struct drm_device *dev);
-void drm_modeset_unregister_all(struct drm_device *dev);
-
 
 /* drm_plane.c */
 int drm_plane_register_all(struct drm_device *dev);
drivers/gpu/drm/drm_mode_config.c new file +399 -0

399 lines not on this page · raw message

include/drm/drm_crtc.h +1 -621

646 lines not on this page · raw message

include/drm/drm_mode_config.h new file +658 -0

658 lines not on this page · raw message

Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 8/10
#22 lore raw

Re: [Intel-gfx] [PATCH 08/10] drm: Extract drm_mode_config.[hc]

Quoted 26 lines · Daniel Vetter

And shuffle the kernel-doc structure a bit since drm_crtc.[hc] now only contains CRTC-related functions and structures.

drivers/gpu/drm/drm_crtc_internal.h +3 -4
index 3d23a473ec35..dad212140d56 100644
@@ -40,18 +40,25 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 			    int x, int y,
 			    const struct drm_display_mode *mode,
 			    const struct drm_framebuffer *fb);
-
-void drm_fb_release(struct drm_file *file_priv);
+int drm_crtc_register_all(struct drm_device *dev);
+void drm_crtc_unregister_all(struct drm_device *dev);
 
 /* IOCTLs */
-int drm_mode_getresources(struct drm_device *dev,
-			  void *data, struct drm_file *file_priv);
 int drm_mode_getcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 int drm_mode_setcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 
+

drivers/gpu/drm/drm_crtc_internal.h int drm_crtc_check_viewport(const struct drm_crtc *crtc, · line 62

Quoted 10 lines
drivers/gpu/drm/drm_crtc_internal.h +8 -0
+/* drm_mode_config.c */
+/* IOCTLs */
+int drm_mode_getresources(struct drm_device *dev,
+			  void *data, struct drm_file *file_priv);
+
+
 /* drm_dumb_buffers.c */
+int drm_modeset_register_all(struct drm_device *dev);
+void drm_modeset_unregister_all(struct drm_device *dev);
 

I was worried for a moment.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#23 lore raw

Re: [PATCH 08/10] drm: Extract drm_mode_config.[hc]

Quoted 26 lines · Chris Wilson
Quoted 25 lines · Daniel Vetter

And shuffle the kernel-doc structure a bit since drm_crtc.[hc] now only contains CRTC-related functions and structures.

drivers/gpu/drm/drm_crtc_internal.h +2 -4
index 3d23a473ec35..dad212140d56 100644
@@ -40,18 +40,25 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 			    int x, int y,
 			    const struct drm_display_mode *mode,
 			    const struct drm_framebuffer *fb);
-
-void drm_fb_release(struct drm_file *file_priv);
+int drm_crtc_register_all(struct drm_device *dev);
+void drm_crtc_unregister_all(struct drm_device *dev);
 
 /* IOCTLs */
-int drm_mode_getresources(struct drm_device *dev,
-			  void *data, struct drm_file *file_priv);
 int drm_mode_getcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 int drm_mode_setcrtc(struct drm_device *dev,
 		     void *data, struct drm_file *file_priv);
 
Quoted 13 lines

drivers/gpu/drm/drm_crtc_internal.h int drm_crtc_check_viewport(const struct drm_crtc *crtc, · line 62

Quoted 11 lines
drivers/gpu/drm/drm_crtc_internal.h +9 -0
+
+/* drm_mode_config.c */
+/* IOCTLs */
+int drm_mode_getresources(struct drm_device *dev,
+			  void *data, struct drm_file *file_priv);
+
+
 /* drm_dumb_buffers.c */
+int drm_modeset_register_all(struct drm_device *dev);
+void drm_modeset_unregister_all(struct drm_device *dev);
 

I was worried for a moment.

Oops, fixed up while applying. Also noticed that I've forgotten to move drm_mode_config_cleanup (besides moving it in headers). Chris was still happy with the revised patch after checking some silliness on irc. -Daniel

Quoted 6 lines

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#24 lore raw

PATCH 9/10 drm: Move tile group code into drm_connector.c

In reply to Daniel Vetter

And also put the overview section into the KMS Properties part of the docs, instead of randomly-placed within the helpers - this is part of the uabi.

With this patch I think drm_crtc.[hc] is cleaned up and entirely documented.

---
 Documentation/gpu/drm-kms-helpers.rst |   8 ---
 Documentation/gpu/drm-kms.rst         |   6 ++
 drivers/gpu/drm/drm_connector.c       | 104 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_crtc.c            |  99 --------------------------------
 include/drm/drm_connector.h           |  24 ++++++++
 include/drm/drm_crtc.h                |  15 -----
 6 files changed, 134 insertions(+), 122 deletions(-)
Documentation/gpu/drm-kms-helpers.rst +0 -8
index bb4254d19cbb..4ca77f675967 100644
@@ -261,14 +261,6 @@ Plane Helper Reference
 .. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
    :export:
 
-Tile group
-==========
-
-# FIXME: This should probably be moved into a property documentation section
-
-.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
-   :doc: Tile group
-
 Auxiliary Modeset Helpers
 =========================
 
Documentation/gpu/drm-kms.rst +6 -0
index a8ff2c87c0e9..568f3c2b6e46 100644
@@ -281,6 +281,12 @@ Color Management Properties
 .. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c
    :export:
 
+Tile Group Property
+-------------------
+
+.. kernel-doc:: drivers/gpu/drm/drm_connector.c
+   :doc: Tile group
+
 Existing KMS Properties
 -----------------------
 
drivers/gpu/drm/drm_connector.c +104 -0

107 lines not on this page · raw message

drivers/gpu/drm/drm_crtc.c +0 -99

102 lines not on this page · raw message

include/drm/drm_connector.h +24 -0
index 3e9727264b65..34f9741ebb5b 100644
@@ -775,6 +775,30 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 					    const struct edid *edid);
 
 /**
+ * struct drm_tile_group - Tile group metadata
+ * @refcount: reference count
+ * @dev: DRM device
+ * @id: tile group id exposed to userspace
+ * @group_data: Sink-private data identifying this group
+ *
+ * @group_data corresponds to displayid vend/prod/serial for external screens
+ * with an EDID.
+ */
+struct drm_tile_group {
+	struct kref refcount;
+	struct drm_device *dev;
+	int id;
+	u8 group_data[8];
+};
+
+struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
+						  char topology[8]);
+struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
+					       char topology[8]);
+void drm_mode_put_tile_group(struct drm_device *dev,
+			     struct drm_tile_group *tg);
+
+/**
  * drm_for_each_connector - iterate over all connectors
  * @connector: the loop cursor
  * @dev: the DRM device
include/drm/drm_crtc.h +0 -15
index 98de488a95a5..cf96b393091a 100644
@@ -67,14 +67,6 @@ static inline uint64_t I642U64(int64_t val)
 	return (uint64_t)*((uint64_t *)&val);
 }
 
-/* data corresponds to displayid vend/prod/serial */
-struct drm_tile_group {
-	struct kref refcount;
-	struct drm_device *dev;
-	int id;
-	u8 group_data[8];
-};
-
 struct drm_crtc;
 struct drm_encoder;
 struct drm_pending_vblank_event;
@@ -810,13 +802,6 @@ extern int drm_crtc_force_disable_all(struct drm_device *dev);
 
 extern int drm_mode_set_config_internal(struct drm_mode_set *set);
 
-extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
-							 char topology[8]);
-extern struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
-					       char topology[8]);
-extern void drm_mode_put_tile_group(struct drm_device *dev,
-				   struct drm_tile_group *tg);
-
 /* Helpers */
 static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
 	uint32_t id)
Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 9/10
#25 lore raw

Re: [PATCH 09/10] drm: Move tile group code into drm_connector.c

Quoted 8 lines · Daniel Vetter

And also put the overview section into the KMS Properties part of the docs, instead of randomly-placed within the helpers - this is part of the uabi.

With this patch I think drm_crtc.[hc] is cleaned up and entirely documented.

Code motion looks ok, placement inside the rst I'll take you at your word.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#26 lore raw

PATCH 10/10 drm: Drop externs from drm_crtc.h

In reply to Daniel Vetter

Just noise.

---
 include/drm/drm_crtc.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
include/drm/drm_crtc.h +7 -7
index cf96b393091a..bcc1a4d1d1a6 100644
@@ -762,14 +762,14 @@ struct drm_mode_set {
 
 #define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
 
-extern __printf(6, 7)
+__printf(6, 7)
 int drm_crtc_init_with_planes(struct drm_device *dev,
 			      struct drm_crtc *crtc,
 			      struct drm_plane *primary,
 			      struct drm_plane *cursor,
 			      const struct drm_crtc_funcs *funcs,
 			      const char *name, ...);
-extern void drm_crtc_cleanup(struct drm_crtc *crtc);
+void drm_crtc_cleanup(struct drm_crtc *crtc);
 
 /**
  * drm_crtc_index - find the index of a registered CRTC
@@ -795,12 +795,12 @@ static inline uint32_t drm_crtc_mask(const struct drm_crtc *crtc)
 	return 1 << drm_crtc_index(crtc);
 }
 
-extern void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
-				   int *hdisplay, int *vdisplay);
-extern int drm_crtc_force_disable(struct drm_crtc *crtc);
-extern int drm_crtc_force_disable_all(struct drm_device *dev);
+void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
+			    int *hdisplay, int *vdisplay);
+int drm_crtc_force_disable(struct drm_crtc *crtc);
+int drm_crtc_force_disable_all(struct drm_device *dev);
 
-extern int drm_mode_set_config_internal(struct drm_mode_set *set);
+int drm_mode_set_config_internal(struct drm_mode_set *set);
 
 /* Helpers */
 static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 10/10
#27 lore raw

Re: [PATCH 10/10] drm: Drop externs from drm_crtc.h

Quoted 3 lines · Daniel Vetter

Just noise.

Sometimes it is interesting. Practice across the kernel is mixed, but convergence on not putting extern.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#28 lore raw

✗ Fi.CI.BAT: warning for drm_crtc.[hc] cleanup and documenation

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm_crtc.[hc] cleanup and documenation
URL : https://patchwork.freedesktop.org/series/15272/
State : warning

== Summary ==

Series 15272v1 drm_crtc.[hc] cleanup and documenation
https://patchwork.freedesktop.org/api/1.0/series/15272/revisions/1/mbox/

Test drv_module_reload_basic:

                pass       -> DMESG-WARN (fi-skl-6770hq)
fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:244  pass:229  dwarn:1   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

020e291d72d4aaf3e0f8f5168a60ac05daa43a77 drm-intel-nightly: 2016y-11m-14d-08h-02m-22s UTC integration manifest 28625c8 doc/dma-buf: Fix up include directives
45a8685c drm/i915: Fixup kerneldoc includes
7e18d70 drm: Extract drm_dumb_buffers.c

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2982/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx