Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1afc4544 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-next-2017-05-26' of git://anongit.freedesktop.org/git/drm-misc into drm-next

UAPI Changes:
- Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI (Robert)

Cross-subsystem Changes:
- Standardize sync_file.txt documentation format (Mauro)

Core Changes:
- Turf drm_[cm]alloc functions for kvmalloc alternatives (Michal)
- Add optional mode_valid() hook to crtc/encoder/bridge (Jose)
- Improve documentation around mode validation/alteration (Daniel)
- Reduce sync_file construction time by deferring name creation (Chris)

Driver Changes:
- pl111: Wire up the clock divider and add debugfs (Eric)
- various: Fix include notation and remove -Iinclude/drm (Masahiro)
- stm: Add Benjamin Gaignard and Vincent Abriou as STM maintainers (Vincent)
- various: Miscellaneous trivial fixes to pl111/stm/vgem/vc4

Cc: Michal Hocko <mhocko@suse.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>

* tag 'drm-misc-next-2017-05-26' of git://anongit.freedesktop.org/git/drm-misc: (55 commits)
  dma-buf/sync-file: Defer creation of sync_file->name
  sync_file.txt: standardize document format
  gpu: drm: gma500: remove two more dead variable
  drm/doc: Clarify mode_fixup vs. atomic_check a bit more
  drm/doc: Document adjusted/request modes a bit better
  drm: Add crtc/encoder/bridge->mode_valid() callbacks
  MAINTAINERS: update drm/stm maintainers list
  drm/stm: ltdc: fix duplicated arguments
  drm/pl111: Fix return value check in pl111_amba_probe()
  drm/amd: include <linux/delay.h> instead of "linux/delay.h"
  drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPI
  drm/vgem: Fix return value check in vgem_init()
  drm/blend: Fix comment typ-o
  drm/stm: remove unneeded -Iinclude/drm compiler flag
  drm/vc4: fix include notation and remove -Iinclude/drm flag
  drm/pl111: Add a debugfs node to dump our registers.
  drm/pl111: make structure mode_config_funcs static
  drm/pl111: make structure pl111_display_funcs static
  drm/pl111: Register the clock divider and use it.
  drm: drop drm_[cm]alloc* helpers
  ...
parents e98c58e5 71ebc9a3
Loading
Loading
Loading
Loading
+13 −10
Original line number Original line Diff line number Diff line
===================
Sync File API Guide
Sync File API Guide
			      ~~~~~~~~~~~~~~~~~~~
===================


				Gustavo Padovan
:Author: Gustavo Padovan <gustavo at padovan dot org>
			  <gustavo at padovan dot org>


This document serves as a guide for device drivers writers on what the
This document serves as a guide for device drivers writers on what the
sync_file API is, and how drivers can support it. Sync file is the carrier of
sync_file API is, and how drivers can support it. Sync file is the carrier of
@@ -46,16 +46,17 @@ Creating Sync Files


When a driver needs to send an out-fence userspace it creates a sync_file.
When a driver needs to send an out-fence userspace it creates a sync_file.


Interface:
Interface::

	struct sync_file *sync_file_create(struct dma_fence *fence);
	struct sync_file *sync_file_create(struct dma_fence *fence);


The caller pass the out-fence and gets back the sync_file. That is just the
The caller pass the out-fence and gets back the sync_file. That is just the
first step, next it needs to install an fd on sync_file->file. So it gets an
first step, next it needs to install an fd on sync_file->file. So it gets an
fd:
fd::


	fd = get_unused_fd_flags(O_CLOEXEC);
	fd = get_unused_fd_flags(O_CLOEXEC);


and installs it on sync_file->file:
and installs it on sync_file->file::


	fd_install(fd, sync_file->file);
	fd_install(fd, sync_file->file);


@@ -71,7 +72,8 @@ When userspace needs to send an in-fence to the driver it passes file descriptor
of the Sync File to the kernel. The kernel can then retrieve the fences
of the Sync File to the kernel. The kernel can then retrieve the fences
from it.
from it.


Interface:
Interface::

	struct dma_fence *sync_file_get_fence(int fd);
	struct dma_fence *sync_file_get_fence(int fd);




@@ -79,5 +81,6 @@ The returned reference is owned by the caller and must be disposed of
afterwards using dma_fence_put(). In case of error, a NULL is returned instead.
afterwards using dma_fence_put(). In case of error, a NULL is returned instead.


References:
References:
[1] struct sync_file in include/linux/sync_file.h

[2] All interfaces mentioned above defined in include/linux/sync_file.h
1. struct sync_file in include/linux/sync_file.h
2. All interfaces mentioned above defined in include/linux/sync_file.h
+2 −0
Original line number Original line Diff line number Diff line
@@ -4502,6 +4502,8 @@ F: Documentation/devicetree/bindings/display/st,stih4xx.txt
DRM DRIVERS FOR STM
DRM DRIVERS FOR STM
M:	Yannick Fertre <yannick.fertre@st.com>
M:	Yannick Fertre <yannick.fertre@st.com>
M:	Philippe Cornu <philippe.cornu@st.com>
M:	Philippe Cornu <philippe.cornu@st.com>
M:	Benjamin Gaignard <benjamin.gaignard@linaro.org>
M:	Vincent Abriou <vincent.abriou@st.com>
L:	dri-devel@lists.freedesktop.org
L:	dri-devel@lists.freedesktop.org
T:	git git://anongit.freedesktop.org/drm/drm-misc
T:	git git://anongit.freedesktop.org/drm/drm-misc
S:	Maintained
S:	Maintained
+3 −1
Original line number Original line Diff line number Diff line
@@ -132,9 +132,11 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
static void sync_print_sync_file(struct seq_file *s,
static void sync_print_sync_file(struct seq_file *s,
				  struct sync_file *sync_file)
				  struct sync_file *sync_file)
{
{
	char buf[128];
	int i;
	int i;


	seq_printf(s, "[%p] %s: %s\n", sync_file, sync_file->name,
	seq_printf(s, "[%p] %s: %s\n", sync_file,
		   sync_file_get_name(sync_file, buf, sizeof(buf)),
		   sync_status_str(dma_fence_get_status(sync_file->fence)));
		   sync_status_str(dma_fence_get_status(sync_file->fence)));


	if (dma_fence_is_array(sync_file->fence)) {
	if (dma_fence_is_array(sync_file->fence)) {
+32 −7
Original line number Original line Diff line number Diff line
@@ -80,11 +80,6 @@ struct sync_file *sync_file_create(struct dma_fence *fence)


	sync_file->fence = dma_fence_get(fence);
	sync_file->fence = dma_fence_get(fence);


	snprintf(sync_file->name, sizeof(sync_file->name), "%s-%s%llu-%d",
		 fence->ops->get_driver_name(fence),
		 fence->ops->get_timeline_name(fence), fence->context,
		 fence->seqno);

	return sync_file;
	return sync_file;
}
}
EXPORT_SYMBOL(sync_file_create);
EXPORT_SYMBOL(sync_file_create);
@@ -129,6 +124,36 @@ struct dma_fence *sync_file_get_fence(int fd)
}
}
EXPORT_SYMBOL(sync_file_get_fence);
EXPORT_SYMBOL(sync_file_get_fence);


/**
 * sync_file_get_name - get the name of the sync_file
 * @sync_file:		sync_file to get the fence from
 * @buf:		destination buffer to copy sync_file name into
 * @len:		available size of destination buffer.
 *
 * Each sync_file may have a name assigned either by the user (when merging
 * sync_files together) or created from the fence it contains. In the latter
 * case construction of the name is deferred until use, and so requires
 * sync_file_get_name().
 *
 * Returns: a string representing the name.
 */
char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len)
{
	if (sync_file->user_name[0]) {
		strlcpy(buf, sync_file->user_name, len);
	} else {
		struct dma_fence *fence = sync_file->fence;

		snprintf(buf, len, "%s-%s%llu-%d",
			 fence->ops->get_driver_name(fence),
			 fence->ops->get_timeline_name(fence),
			 fence->context,
			 fence->seqno);
	}

	return buf;
}

static int sync_file_set_fence(struct sync_file *sync_file,
static int sync_file_set_fence(struct sync_file *sync_file,
			       struct dma_fence **fences, int num_fences)
			       struct dma_fence **fences, int num_fences)
{
{
@@ -266,7 +291,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
		goto err;
		goto err;
	}
	}


	strlcpy(sync_file->name, name, sizeof(sync_file->name));
	strlcpy(sync_file->user_name, name, sizeof(sync_file->user_name));
	return sync_file;
	return sync_file;


err:
err:
@@ -413,7 +438,7 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
	}
	}


no_fences:
no_fences:
	strlcpy(info.name, sync_file->name, sizeof(info.name));
	sync_file_get_name(sync_file, info.name, sizeof(info.name));
	info.status = dma_fence_is_signaled(sync_file->fence);
	info.status = dma_fence_is_signaled(sync_file->fence);
	info.num_fences = num_fences;
	info.num_fences = num_fences;


+1 −1
Original line number Original line Diff line number Diff line
@@ -4,7 +4,7 @@


FULL_AMD_PATH=$(src)/..
FULL_AMD_PATH=$(src)/..


ccflags-y := -Iinclude/drm -I$(FULL_AMD_PATH)/include/asic_reg \
ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
	-I$(FULL_AMD_PATH)/include \
	-I$(FULL_AMD_PATH)/include \
	-I$(FULL_AMD_PATH)/amdgpu \
	-I$(FULL_AMD_PATH)/amdgpu \
	-I$(FULL_AMD_PATH)/scheduler \
	-I$(FULL_AMD_PATH)/scheduler \
Loading