linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: "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@chr>
Subject: Re: [PATCH v3 1/5] drm/rockchip: Add basic drm driver
Date: Tue, 23 Sep 2014 16:00:43 +0800	[thread overview]
Message-ID: <542128AB.5030905@rock-chips.com> (raw)
In-Reply-To: <20140923074831.GR15734@phenom.ffwll.local>

On 2014年09月23日 15:48, Daniel Vetter wrote:
> 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
right, I will try to do it.



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-09-23  8:00 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
     [not found] ` <1411105668-32722-1-git-send-email-mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-09-19  5:47   ` [PATCH v3 1/5] drm/rockchip: Add basic drm driver Mark yao
2014-09-19 13:04     ` David Herrmann
     [not found]       ` <CANq1E4Ti0yOQ+jCiXy7=NtFQ9cbWLOSLf6q-HWVdDFtMB1n29Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-22  1:27         ` Mark yao
     [not found]     ` <1411105668-32722-2-git-send-email-mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-09-20  0:03       ` Rob Clark
     [not found]         ` <CAF6AEGsPoj6+PdKCJk5BPPzHS51Tz1FGqS2SjpartaRw7i=Pxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-22  1:32           ` Mark yao
2014-09-23  7:48             ` Daniel Vetter
2014-09-23  8:00               ` Mark yao [this message]
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=542128AB.5030905@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=cf@rock-chips.com \
    --cc=cym@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=grant.likely@linaro.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@chr \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=wxt@rock-chips.com \
    --cc=xjq@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;
as well as URLs for NNTP newsgroup(s).