CHROMIUM: add special ioctl for rockchip libdrm [chromiumos/third_party/kernel : chromeos-3.14]

44 views
Skip to first unread message

智情 姚 (Gerrit)

unread,
Oct 8, 2014, 6:29:37 AM10/8/14
to Olof Johansson
智情 姚 has uploaded a new change for review.

https://chromium-review.googlesource.com/222153

Change subject: CHROMIUM: add special ioctl for rockchip libdrm
......................................................................

CHROMIUM: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Signed-off-by: Mark Yao <mark...@rock-chips.com>
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)



diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index f1a1b54..1532368 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -24,6 +24,8 @@
#include <linux/of_graph.h>
#include <linux/component.h>

+#include <drm/rockchip_drm.h>
+
#include "rockchip_drm_drv.h"
#include "rockchip_drm_fb.h"
#include "rockchip_drm_fbdev.h"
@@ -166,6 +168,14 @@
drm_fb_helper_restore_fbdev_mode_unlocked(&priv->fbdev_helper);
}

+static const struct drm_ioctl_desc rockchip_ioctls[] = {
+ DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_CREATE, rockchip_gem_create_ioctl,
+ DRM_UNLOCKED | DRM_AUTH),
+ DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_MAP_OFFSET,
+ rockchip_gem_map_offset_ioctl, DRM_UNLOCKED |
+ DRM_AUTH),
+};
+
static const struct file_operations rockchip_drm_driver_fops = {
.owner = THIS_MODULE,
.open = drm_open,
@@ -204,6 +214,8 @@
.gem_prime_get_sg_table = rockchip_gem_prime_get_sg_table,
.gem_prime_vmap = rockchip_gem_prime_vmap,
.gem_prime_vunmap = rockchip_gem_prime_vunmap,
+ .ioctls = rockchip_ioctls,
+ .num_ioctls = ARRAY_SIZE(rockchip_ioctls),
.fops = &rockchip_drm_driver_fops,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index edb645b..ea25261 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -15,6 +15,7 @@
#include <drm/drm.h>
#include <drm/drmP.h>
#include <drm/drm_vma_manager.h>
+#include <drm/rockchip_drm.h>

#include <linux/dma-attrs.h>

@@ -251,6 +252,26 @@
return PTR_ERR_OR_ZERO(rk_obj);
}

+int rockchip_gem_map_offset_ioctl(struct drm_device *drm, void *data,
+ struct drm_file *file_priv)
+{
+ struct drm_rockchip_gem_map_off *args = data;
+
+ return rockchip_gem_dumb_map_offset(file_priv, drm, args->handle,
+ &args->offset);
+}
+
+int rockchip_gem_create_ioctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
+{
+ struct drm_rockchip_gem_create *args = data;
+ struct rockchip_gem_object *rk_obj;
+
+ rk_obj = rockchip_gem_create_with_handle(file_priv, dev, args->size,
+ &args->handle);
+ return PTR_ERR_OR_ZERO(rk_obj);
+}
+
/*
* Allocate a sg_table for this GEM object.
* Note: Both the table's contents, and the sg_table itself must be freed
by
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
index 67bcebe..21775fe 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
@@ -51,4 +51,18 @@
int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
struct drm_device *dev, uint32_t handle,
uint64_t *offset);
+int rockchip_gem_map_offset_ioctl(struct drm_device *drm, void *data,
+ struct drm_file *file_priv);
+/*
+ * request gem object creation and buffer allocation as the size
+ * that it is calculated with framebuffer information such as width,
+ * height and bpp.
+ */
+int rockchip_gem_create_ioctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv);
+
+/* get buffer offset to map to user space. */
+int rockchip_gem_map_offset_ioctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv);
+
#endif /* _ROCKCHIP_DRM_GEM_H */
diff --git a/include/uapi/drm/rockchip_drm.h
b/include/uapi/drm/rockchip_drm.h
new file mode 100644
index 0000000..c521e5a
--- /dev/null
+++ b/include/uapi/drm/rockchip_drm.h
@@ -0,0 +1,57 @@
+/*
+ *
+ * Copyright (c) Fuzhou Rockchip Electronics Co.Ltd
+ * Authors:
+ * Mark Yao <y...@rock-chips.com>
+ *
+ * base on exynos_drm.h
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#ifndef _UAPI_ROCKCHIP_DRM_H
+#define _UAPI_ROCKCHIP_DRM_H
+
+#include <drm/drm.h>
+
+/**
+ * User-desired buffer creation information structure.
+ *
+ * @size: user-desired memory allocation size.
+ * @flags: user request for setting memory type or cache attributes.
+ * @handle: returned a handle to created gem object.
+ * - this handle will be set by gem module of kernel side.
+ */
+struct drm_rockchip_gem_create {
+ uint64_t size;
+ uint32_t flags;
+ uint32_t handle;
+};
+
+/**
+ * A structure for getting buffer offset.
+ *
+ * @handle: a pointer to gem object created.
+ * @pad: just padding to be 64-bit aligned.
+ * @offset: relatived offset value of the memory region allocated.
+ * - this value should be set by user.
+ */
+struct drm_rockchip_gem_map_off {
+ uint32_t handle;
+ uint32_t pad;
+ uint64_t offset;
+};
+
+#define DRM_ROCKCHIP_GEM_CREATE 0x00
+#define DRM_ROCKCHIP_GEM_MAP_OFFSET 0x01
+
+#define DRM_IOCTL_ROCKCHIP_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_ROCKCHIP_GEM_CREATE, struct drm_rockchip_gem_create)
+
+#define DRM_IOCTL_ROCKCHIP_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_ROCKCHIP_GEM_MAP_OFFSET, struct drm_rockchip_gem_map_off)
+
+#endif /* _UAPI_ROCKCHIP_DRM_H */

--
To view, visit https://chromium-review.googlesource.com/222153
To unsubscribe, visit https://chromium-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

智情 姚 (Gerrit)

unread,
Oct 8, 2014, 6:37:55 AM10/8/14
to Stéphane Marchesin, Daniel Kurtz
智情 姚 has uploaded a new patch set (#2).

Change subject: CHROMIUM: add special ioctl for rockchip libdrm
......................................................................

CHROMIUM: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Signed-off-by: Mark Yao <mark...@rock-chips.com>
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Gerrit-Reviewer: Daniel Kurtz <djk...@chromium.org>
Gerrit-Reviewer: Stéphane Marchesin <mar...@chromium.org>

智情 姚 (Gerrit)

unread,
Oct 8, 2014, 6:39:37 AM10/8/14
to Stéphane Marchesin, Daniel Kurtz
智情 姚 has uploaded a new patch set (#3).

Change subject: CHROMIUM: add special ioctl for rockchip libdrm
......................................................................

CHROMIUM: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Signed-off-by: Mark Yao <mark...@rock-chips.com>
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 3
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

智情 姚 (Gerrit)

unread,
Oct 10, 2014, 12:37:35 AM10/10/14
to Stéphane Marchesin, Sean Paul, Daniel Kurtz, Dominik Behr
智情 姚 has uploaded a new patch set (#4).

Change subject: CHROMIUM: add special ioctl for rockchip libdrm
......................................................................

CHROMIUM: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Signed-off-by: Mark Yao <mark...@rock-chips.com>
Signed-off-by: Mark Yao <y...@rock-chips.com>
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 4
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Gerrit-Reviewer: Daniel Kurtz <djk...@chromium.org>
Gerrit-Reviewer: Dominik Behr <db...@chromium.org>
Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
Gerrit-Reviewer: Stéphane Marchesin <mar...@chromium.org>

智情 姚 (Gerrit)

unread,
Oct 10, 2014, 12:50:14 AM10/10/14
to Stéphane Marchesin, Sean Paul, Daniel Kurtz, Dominik Behr
智情 姚 has uploaded a new patch set (#5).

Change subject: CHROMIUM: add special ioctl for rockchip libdrm
......................................................................

CHROMIUM: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Signed-off-by: Mark Yao <mark...@rock-chips.com>
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 5
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 10, 2014, 11:04:25 AM10/10/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has uploaded a new patch set (#6).

Change subject: CHROMIUM: drm/rockchip: add special ioctl for rockchip
libdrm
......................................................................

CHROMIUM: drm/rockchip: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 6
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 10, 2014, 2:15:03 PM10/10/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has uploaded a new patch set (#7).

Change subject: CHROMIUM: drm/rockchip: add special ioctl for rockchip
libdrm
......................................................................

CHROMIUM: drm/rockchip: add special ioctl for rockchip libdrm

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 7
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Stéphane Marchesin (Gerrit)

unread,
Oct 13, 2014, 2:48:29 PM10/13/14
to Daniel Kurtz, 智情 姚, Sean Paul, Dominik Behr
Stéphane Marchesin has posted comments on this change.

Change subject: CHROMIUM: drm/rockchip: add special ioctl for rockchip
libdrm
......................................................................


Patch Set 7:

(1 comment)

one nit, LGTM otherwise

https://chromium-review.googlesource.com/#/c/222153/7//COMMIT_MSG
Commit Message:

Line 7: CHROMIUM: drm/rockchip: add special ioctl for rockchip libdrm
can you rephrase this? or example:

drm/rockchip: Add GEM create ioctl support
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 7
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Gerrit-Reviewer: Daniel Kurtz <djk...@chromium.org>
Gerrit-Reviewer: Dominik Behr <db...@chromium.org>
Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
Gerrit-Reviewer: Stéphane Marchesin <mar...@chromium.org>
Gerrit-HasComments: Yes

智情 姚 (Gerrit)

unread,
Oct 14, 2014, 5:41:08 AM10/14/14
to Stéphane Marchesin, Sean Paul, Daniel Kurtz, Dominik Behr
智情 姚 has uploaded a new patch set (#8).

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................

CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 8
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

智情 姚 (Gerrit)

unread,
Oct 14, 2014, 5:41:45 AM10/14/14
to Daniel Kurtz, Stéphane Marchesin, Sean Paul, Dominik Behr
智情 姚 has posted comments on this change.

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................


Patch Set 7:

(1 comment)

https://chromium-review.googlesource.com/#/c/222153/7//COMMIT_MSG
Commit Message:

Line 7: CHROMIUM: drm/rockchip: add special ioctl for rockchip libdrm
> can you rephrase this? or example:
Done
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 7
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Gerrit-Reviewer: Daniel Kurtz <djk...@chromium.org>
Gerrit-Reviewer: Dominik Behr <db...@chromium.org>
Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
Gerrit-Reviewer: Stéphane Marchesin <mar...@chromium.org>
Gerrit-Reviewer: 智情 姚 <mark...@rock-chips.com>
Gerrit-HasComments: Yes

Daniel Kurtz (Gerrit)

unread,
Oct 15, 2014, 5:47:31 AM10/15/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has posted comments on this change.

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................


Patch Set 8: Code-Review+1

(4 comments)

Since this ioctls are CHROMIUM only, and we control userspace, I am ok with
committing them as they are, and changing them later.

https://chromium-review.googlesource.com/#/c/222153/8/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
File drivers/gpu/drm/rockchip/rockchip_drm_drv.c:

Line 175: DRM_UNLOCKED |
nit: move down to DRM_AUTH line.

marcheu: Do we really want the MAP_OFFSET ioctl?

Wouldn't it be better to force user space to always use prime/dma_buf for
mapping non-dumb gem buffers - even for a client's own buffers?


https://chromium-review.googlesource.com/#/c/222153/8/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
File drivers/gpu/drm/rockchip/rockchip_drm_gem.c:

Line 238: /*
: * align to 64 bytes since Mali requires it.
: */
Remove this comment.

The dumb buffers need not be aligned for mali, since they are not written
to by the GPU.

In fact, the dumb buffers (like the fbdev buffer) need not be aligned at
all, unless the VOP requires it?


Line 269:
When using the gem create ioctl to allocate the backing buffer of a
framebuffer, userspace is now responsible for choosing a framebuffer pitch
that is aligned per (mali) gpu requirements, and ensuring that the gem
buffer is sized appropriately. This ioctl can no longer enforce
pitch-alignment.


https://chromium-review.googlesource.com/#/c/222153/8/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
File drivers/gpu/drm/rockchip/rockchip_drm_gem.h:

Line 58: width,
: * height and bpp.
Create a gem buffer suitable for use with the gpu.
If the gem buffer is to be used as a framebuffer accessed by the gpu, it is
the responsibility of userspace to ensure that the framebuffer's pitch is
aligned to 64-bytes.
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 8
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

智情 姚 (Gerrit)

unread,
Oct 20, 2014, 4:29:24 AM10/20/14
to Daniel Kurtz, Stéphane Marchesin, Sean Paul, Dominik Behr
Hello Daniel Kurtz,

I'd like you to reexamine a change. Please visit

https://chromium-review.googlesource.com/222153

to look at the new patch set (#9).

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................

CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 9
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 20, 2014, 11:47:58 AM10/20/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has uploaded a new patch set (#10).

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................

CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 10
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 20, 2014, 12:07:37 PM10/20/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has uploaded a new patch set (#11).

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................

CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 11
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 20, 2014, 10:46:45 PM10/20/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has uploaded a new patch set (#12).

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................

CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 12
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 20, 2014, 11:01:34 PM10/20/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has uploaded a new patch set (#13).

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................

CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)


Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 13
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 20, 2014, 11:04:59 PM10/20/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has posted comments on this change.

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................


Patch Set 13: Code-Review+2 Verified+1
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 13
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Gerrit-Reviewer: Daniel Kurtz <djk...@chromium.org>
Gerrit-Reviewer: Dominik Behr <db...@chromium.org>
Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
Gerrit-Reviewer: Stéphane Marchesin <mar...@chromium.org>
Gerrit-Reviewer: 智情 姚 <mark...@rock-chips.com>
Gerrit-HasComments: No

Daniel Kurtz (Gerrit)

unread,
Oct 20, 2014, 11:07:03 PM10/20/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr
Daniel Kurtz has posted comments on this change.

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................


Patch Set 13: Commit-Queue+1
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 13
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>

Daniel Kurtz (Gerrit)

unread,
Oct 21, 2014, 2:39:16 AM10/21/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr, chrome-internal-fetch
Daniel Kurtz has posted comments on this change.

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................


Patch Set 13: Commit-Queue+1

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 13
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Gerrit-Reviewer: Daniel Kurtz <djk...@chromium.org>
Gerrit-Reviewer: Dominik Behr <db...@chromium.org>
Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
Gerrit-Reviewer: Stéphane Marchesin <mar...@chromium.org>
Gerrit-Reviewer: chrome-internal-fetch <chrome-int...@google.com>

chrome-internal-fetch (Gerrit)

unread,
Oct 21, 2014, 6:41:01 AM10/21/14
to 智情 姚, Stéphane Marchesin, Sean Paul, Dominik Behr, Daniel Kurtz
chrome-internal-fetch has submitted this change and it was merged.

Change subject: CHROMIUM: drm/rockchip: Add GEM create ioctl support
......................................................................


CHROMIUM: drm/rockchip: Add GEM create ioctl support

Rockchip Socs have GPU, we need allocate GPU accelerated buffers.
So add special ioctls GEM_CREATE/GEM_MAP_OFFSET to support
accelerated buffers.

Signed-off-by: Mark Yao <mark...@rock-chips.com>

BUG=chromium:399935
TEST=With rest of patch set, can boot to UI on eDP

Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Reviewed-on: https://chromium-review.googlesource.com/222153
Reviewed-by: Daniel Kurtz <djk...@chromium.org>
Tested-by: Daniel Kurtz <djk...@chromium.org>
Commit-Queue: Daniel Kurtz <djk...@chromium.org>
---
M drivers/gpu/drm/rockchip/rockchip_drm_drv.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.c
M drivers/gpu/drm/rockchip/rockchip_drm_gem.h
A include/uapi/drm/rockchip_drm.h
4 files changed, 104 insertions(+), 0 deletions(-)

Approvals:
Daniel Kurtz: Looks good to me, approved; Ready; Verified



diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 0a50b6f..f6f0ced 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -24,6 +24,8 @@
#include <linux/of_graph.h>
#include <linux/component.h>

+#include <drm/rockchip_drm.h>
+
#include "rockchip_drm_drv.h"
#include "rockchip_drm_fb.h"
#include "rockchip_drm_fbdev.h"
@@ -166,6 +168,14 @@
drm_fb_helper_restore_fbdev_mode_unlocked(&priv->fbdev_helper);
}

+static const struct drm_ioctl_desc rockchip_ioctls[] = {
+ DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_CREATE, rockchip_gem_create_ioctl,
+ DRM_UNLOCKED | DRM_AUTH),
+ DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_MAP_OFFSET,
+ rockchip_gem_map_offset_ioctl,
+ DRM_UNLOCKED | DRM_AUTH),
+};
+
static const struct file_operations rockchip_drm_driver_fops = {
.owner = THIS_MODULE,
.open = drm_open,
@@ -210,6 +220,8 @@
.atomic_commit = drm_atomic_commit,
.atomic_end = drm_atomic_end,
.atomic_funcs = &drm_atomic_funcs,
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4b13798aac97d16214da7a75a2479e6e334313e
Gerrit-PatchSet: 14
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.14
Gerrit-Owner: 智情 姚 <mark...@rock-chips.com>
Reply all
Reply to author
Forward
0 new messages