public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Rob Clark <robdclark@gmail.com>
Cc: "Heiko Stübner" <heiko@sntech.de>,
	"Boris BREZILLON" <boris.brezillon@free-electrons.com>,
	"David Airlie" <airlied@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"John Stultz" <john.stultz@linaro.org>,
	"Rom Lemarchand" <romlem@google.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-doc@vger.kernel.org,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	linux-api@vger.kernel.org, linux-rockchip@lists.infradead.org,
	dianders@chromium.org,
	"Stéphane Marchesin" <marcheu@chromium.org>,
	dbehr@chromium.org, "Olof Johansson" <olof@lixom.net>,
	"Daniel Kurtz" <djkurtz@chromium.org>,
	"Jianqun Xu" <xjq@rock-chips.com>,
	kfx@rock-chips.com, "jeff chen" <cym@rock-chips.com>,
	"Eddie Cai" <cf@rock-chips.com>,
	"Chris Zhong" <zyw@rock-chips.com>,
	xxm@rock-chips.com, "Tao Huang" <huangtao@rock-chips.com>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	yxj@rock-chips.com, wxt@rock-chips.com, xw@rock-chips.com
Subject: Re: [PATCH v3 1/5] drm/rockchip: Add basic drm driver
Date: Mon, 22 Sep 2014 09:32:19 +0800	[thread overview]
Message-ID: <541F7C23.8000103@rock-chips.com> (raw)
In-Reply-To: <CAF6AEGsPoj6+PdKCJk5BPPzHS51Tz1FGqS2SjpartaRw7i=Pxg@mail.gmail.com>

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.
>
>> +/**
>> + * A structure to gem information.
>> + *
>> + * @handle: a handle to gem object created.
>> + * @flags: flag value including memory type and cache attribute and
>> + *      this value would be set by driver.
>> + * @size: size to memory region allocated by gem and this size would
>> + *      be set by driver.
>> + */
>> +struct drm_rockchip_gem_info {
>> +       uint32_t handle;
>> +       uint32_t flags;
>> +       uint64_t size;
>> +};
>> +
>> +#define DRM_ROCKCHIP_GEM_CREATE                0x00
>> +#define DRM_ROCKCHIP_GEM_MAP_OFFSET    0x01
>> +#define DRM_ROCKCHIP_GEM_MMAP          0x02
>> +#define DRM_ROCKCHIP_GEM_GET           0x04
>> +
>> +#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)
>> +
>> +#define DRM_IOCTL_ROCKCHIP_GEM_MMAP    DRM_IOWR(DRM_COMMAND_BASE + \
>> +               DRM_ROCKCHIP_GEM_MMAP, struct drm_rockchip_gem_mmap)
>> +
>> +#define DRM_IOCTL_ROCKCHIP_GEM_GET     DRM_IOWR(DRM_COMMAND_BASE + \
>> +               DRM_ROCKCHIP_GEM_GET, struct drm_rockchip_gem_info)
>> +#endif /* _UAPI_ROCKCHIP_DRM_H */
>
>



  reply	other threads:[~2014-09-22  1:32 UTC|newest]

Thread overview: 12+ 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 ` [PATCH v3 1/5] drm/rockchip: Add basic drm driver Mark yao
2014-09-19 13:04   ` David Herrmann
2014-09-22  1:27     ` Mark yao
2014-09-20  0:03   ` Rob Clark
2014-09-22  1:32     ` Mark yao [this message]
2014-09-23  7:48       ` Daniel Vetter
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:53 ` [PATCH v3 3/5] dt-bindings: video: Add documentation for rockchip vop 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: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=541F7C23.8000103@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=cf@rock-chips.com \
    --cc=cym@rock-chips.com \
    --cc=dbehr@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=djkurtz@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=john.stultz@linaro.org \
    --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=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=romlem@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox