All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Mark yao <mark.yao@rock-chips.com>
Cc: "Rob Clark" <robdclark@gmail.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	linux-doc@vger.kernel.org,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Jianqun Xu" <xjq@rock-chips.com>,
	"Chris Zhong" <zyw@rock-chips.com>,
	linux-api@vger.kernel.org, "jeff chen" <cym@rock-chips.com>,
	linux-rockchip@lists.infradead.org, kfx@rock-chips.com,
	"Grant Likely" <grant.likely@linaro.org>,
	wxt@rock-chips.com, "Tao Huang" <huangtao@rock-chips.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	yxj@rock-chips.com, "Eddie Cai" <cf@rock-chips.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Stéphane Marchesin" <marcheu@chromium.org>,
	xxm@rock-chips.com, xw@rock-chips.com,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	dianders@chromium.org, "Kumar Gala" <galak@codeaurora.org>
Subject: Re: [PATCH v3 1/5] drm/rockchip: Add basic drm driver
Date: Tue, 23 Sep 2014 09:48:31 +0200	[thread overview]
Message-ID: <20140923074831.GR15734@phenom.ffwll.local> (raw)
In-Reply-To: <541F7C23.8000103@rock-chips.com>

On Mon, Sep 22, 2014 at 09:32:19AM +0800, Mark yao wrote:
> On 2014年09月20日 08:03, Rob Clark wrote:
> >On Fri, Sep 19, 2014 at 1:47 AM, Mark yao <mark.yao@rock-chips.com> wrote:
> >>diff --git a/include/uapi/drm/rockchip_drm.h b/include/uapi/drm/rockchip_drm.h
> >>new file mode 100644
> >>index 0000000..8f8e60e
> >>--- /dev/null
> >>+++ b/include/uapi/drm/rockchip_drm.h
> >>@@ -0,0 +1,97 @@
> >>+/*
> >>+ *
> >>+ * Copyright (c) Fuzhou Rockchip Electronics Co.Ltd
> >>+ * Authors:
> >>+ *       Mark Yao <yzq@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;
> >>+};
> >>+
> >>+/**
> >>+ * A structure for mapping buffer.
> >>+ *
> >>+ * @handle: a handle to gem object created.
> >>+ * @pad: just padding to be 64-bit aligned.
> >>+ * @size: memory size to be mapped.
> >>+ * @mapped: having user virtual address mmaped.
> >>+ *      - this variable would be filled by rockchip gem module
> >>+ *      of kernel side with user virtual address which is allocated
> >>+ *      by do_mmap().
> >>+ */
> >>+struct drm_rockchip_gem_mmap {
> >>+       uint32_t handle;
> >>+       uint32_t pad;
> >>+       uint64_t size;
> >>+       uint64_t mapped;
> >>+};
> >Could we do without the mmap ioctl?  It has been a source of problems
> >in other drivers, and the ioctl to get mmap offset, plus normal mmap()
> >on drm device file should be sufficient
> >
> >BR,
> >-R
> OK, I will try to move the special mmap ioctl and use drm generic mmap
> interface.

Actually you probably should drop all this and just implement the dummy
object support for now. Until you have proper hw accel there's no reason
to expose a driver-private gem create/mmap interface at all.

A pure kms driver really shouldn't have it's on uapi/foo_drm.h file.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Mark yao <mark.yao@rock-chips.com>
Cc: "Rob Clark" <robdclark@gmail.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	linux-doc@vger.kernel.org,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Jianqun Xu" <xjq@rock-chips.com>,
	"Chris Zhong" <zyw@rock-chips.com>,
	linux-api@vger.kernel.org, "jeff chen" <cym@rock-chips.com>,
	linux-rockchip@lists.infradead.org, kfx@rock-chips.com,
	"Grant Likely" <grant.likely@linaro.org>,
	wxt@rock-chips.com, "Tao Huang" <huangtao@rock-chips.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	yxj@rock-chips.com, "Eddie Cai" <cf@rock-chips.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Stéphane Marchesin" <marcheu@chromium.org>
Subject: Re: [PATCH v3 1/5] drm/rockchip: Add basic drm driver
Date: Tue, 23 Sep 2014 09:48:31 +0200	[thread overview]
Message-ID: <20140923074831.GR15734@phenom.ffwll.local> (raw)
In-Reply-To: <541F7C23.8000103@rock-chips.com>

On Mon, Sep 22, 2014 at 09:32:19AM +0800, Mark yao wrote:
> On 2014年09月20日 08:03, Rob Clark wrote:
> >On Fri, Sep 19, 2014 at 1:47 AM, Mark yao <mark.yao@rock-chips.com> wrote:
> >>diff --git a/include/uapi/drm/rockchip_drm.h b/include/uapi/drm/rockchip_drm.h
> >>new file mode 100644
> >>index 0000000..8f8e60e
> >>--- /dev/null
> >>+++ b/include/uapi/drm/rockchip_drm.h
> >>@@ -0,0 +1,97 @@
> >>+/*
> >>+ *
> >>+ * Copyright (c) Fuzhou Rockchip Electronics Co.Ltd
> >>+ * Authors:
> >>+ *       Mark Yao <yzq@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;
> >>+};
> >>+
> >>+/**
> >>+ * A structure for mapping buffer.
> >>+ *
> >>+ * @handle: a handle to gem object created.
> >>+ * @pad: just padding to be 64-bit aligned.
> >>+ * @size: memory size to be mapped.
> >>+ * @mapped: having user virtual address mmaped.
> >>+ *      - this variable would be filled by rockchip gem module
> >>+ *      of kernel side with user virtual address which is allocated
> >>+ *      by do_mmap().
> >>+ */
> >>+struct drm_rockchip_gem_mmap {
> >>+       uint32_t handle;
> >>+       uint32_t pad;
> >>+       uint64_t size;
> >>+       uint64_t mapped;
> >>+};
> >Could we do without the mmap ioctl?  It has been a source of problems
> >in other drivers, and the ioctl to get mmap offset, plus normal mmap()
> >on drm device file should be sufficient
> >
> >BR,
> >-R
> OK, I will try to move the special mmap ioctl and use drm generic mmap
> interface.

Actually you probably should drop all this and just implement the dummy
object support for now. Until you have proper hw accel there's no reason
to expose a driver-private gem create/mmap interface at all.

A pure kms driver really shouldn't have it's on uapi/foo_drm.h file.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-09-23  7:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19  5:47 [PATCH v3 0/5] Add drm driver for Rockchip Socs Mark yao
2014-09-19  5:47 ` Mark yao
2014-09-19  5:47 ` [PATCH v3 1/5] drm/rockchip: Add basic drm driver Mark yao
2014-09-19  5:47   ` Mark yao
2014-09-19 13:04   ` David Herrmann
2014-09-19 13:04     ` David Herrmann
2014-09-22  1:27     ` Mark yao
2014-09-22  1:27       ` Mark yao
2014-09-20  0:03   ` Rob Clark
2014-09-20  0:03     ` Rob Clark
2014-09-22  1:32     ` Mark yao
2014-09-22  1:32       ` Mark yao
2014-09-23  7:48       ` Daniel Vetter [this message]
2014-09-23  7:48         ` Daniel Vetter
2014-09-23  8:00         ` Mark yao
2014-09-23  8:00           ` Mark yao
2014-09-19  5:52 ` [PATCH v3 2/5] dt-bindings: video: Add for rockchip display subsytem Mark yao
2014-09-19  5:52   ` Mark yao
2014-09-19  5:53 ` [PATCH v3 3/5] dt-bindings: video: Add documentation for rockchip vop Mark yao
2014-09-19  5:53   ` Mark yao
2014-09-19  5:54 ` [PATCH v3 4/5] dt-bindings: video: Add documentation for rockchip edp Mark yao
2014-09-19  5:54   ` Mark yao
2014-09-19  5:56 ` [PATCH v3 5/5] drm/rockchip: Add support for Rockchip Soc EDP Mark yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140923074831.GR15734@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=cf@rock-chips.com \
    --cc=cym@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kever.yang@rock-chips.com \
    --cc=kfx@rock-chips.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=marcheu@chromium.org \
    --cc=mark.rutland@arm.com \
    --cc=mark.yao@rock-chips.com \
    --cc=pawel.moll@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=wxt@rock-chips.com \
    --cc=xjq@rock-chips.com \
    --cc=xw@rock-chips.com \
    --cc=xxm@rock-chips.com \
    --cc=yxj@rock-chips.com \
    --cc=zyw@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.