diff mbox

[v3] drm/tegra: Use 64-bit offset for tegra_gem_mmap

Message ID 1422644221-24432-1-git-send-email-seanpaul@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Paul Jan. 30, 2015, 6:57 p.m. UTC
On 64-bit targets, tegra_gem_mmap doesn't return the
offset to userspace. As such, subsequent calls to mmap(2)
fail. Alter the args to use 64-bit offset to fix this.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 include/uapi/drm/tegra_drm.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thierry Reding Feb. 6, 2015, 12:18 p.m. UTC | #1
On Fri, Jan 30, 2015 at 01:57:01PM -0500, Sean Paul wrote:
> On 64-bit targets, tegra_gem_mmap doesn't return the
> offset to userspace. As such, subsequent calls to mmap(2)
> fail. Alter the args to use 64-bit offset to fix this.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  include/uapi/drm/tegra_drm.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

I've applied this with a slightly tweaked commit message.

Thanks,
Thierry
Dmitry Osipenko June 28, 2015, 8:54 p.m. UTC | #2
06.02.2015 15:18, Thierry Reding ?????:
> On Fri, Jan 30, 2015 at 01:57:01PM -0500, Sean Paul wrote:
>> On 64-bit targets, tegra_gem_mmap doesn't return the
>> offset to userspace. As such, subsequent calls to mmap(2)
>> fail. Alter the args to use 64-bit offset to fix this.
>>
>> Signed-off-by: Sean Paul <seanpaul@chromium.org>
>> ---
>>   include/uapi/drm/tegra_drm.h | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> I've applied this with a slightly tweaked commit message.
>
> Thanks,
> Thierry
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Why it doesn't have stable tag?
Dave Airlie June 29, 2015, 4:16 a.m. UTC | #3
On 6 February 2015 at 22:18, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Fri, Jan 30, 2015 at 01:57:01PM -0500, Sean Paul wrote:
>> On 64-bit targets, tegra_gem_mmap doesn't return the
>> offset to userspace. As such, subsequent calls to mmap(2)
>> fail. Alter the args to use 64-bit offset to fix this.
>>
>> Signed-off-by: Sean Paul <seanpaul@chromium.org>
>> ---
>>  include/uapi/drm/tegra_drm.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> I've applied this with a slightly tweaked commit message.

Doesn't that break 32-bit ABI?

Dave.
Thierry Reding June 29, 2015, 8:46 a.m. UTC | #4
On Sun, Jun 28, 2015 at 11:54:12PM +0300, Dmitry wrote:
> 06.02.2015 15:18, Thierry Reding ?????:
> >On Fri, Jan 30, 2015 at 01:57:01PM -0500, Sean Paul wrote:
> >>On 64-bit targets, tegra_gem_mmap doesn't return the
> >>offset to userspace. As such, subsequent calls to mmap(2)
> >>fail. Alter the args to use 64-bit offset to fix this.
> >>
> >>Signed-off-by: Sean Paul <seanpaul@chromium.org>
> >>---
> >>  include/uapi/drm/tegra_drm.h | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> >I've applied this with a slightly tweaked commit message.
> >
> >Thanks,
> >Thierry
> >
> >
> >
> >_______________________________________________
> >dri-devel mailing list
> >dri-devel@lists.freedesktop.org
> >http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> Why it doesn't have stable tag?

It's an experimental feature (guarded by STAGING) that doesn't have any
users except proof of concept code, hence I didn't think it appropriate
to burden stable kernel maintainers with it.

Thierry
Thierry Reding June 29, 2015, 8:50 a.m. UTC | #5
On Mon, Jun 29, 2015 at 02:16:17PM +1000, Dave Airlie wrote:
> On 6 February 2015 at 22:18, Thierry Reding <thierry.reding@gmail.com> wrote:
> > On Fri, Jan 30, 2015 at 01:57:01PM -0500, Sean Paul wrote:
> >> On 64-bit targets, tegra_gem_mmap doesn't return the
> >> offset to userspace. As such, subsequent calls to mmap(2)
> >> fail. Alter the args to use 64-bit offset to fix this.
> >>
> >> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> >> ---
> >>  include/uapi/drm/tegra_drm.h | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > I've applied this with a slightly tweaked commit message.
> 
> Doesn't that break 32-bit ABI?

Yes it does. This was discussed earlier in this thread. The original
patch was to add a separate IOCTL to be used on 64-bit architectures
because the 32-bit IOCTL was broken. After some discussion everybody
involved agreed that it'd be best to fix the IOCTL while we can (the
driver-specific IOCTLs in the Tegra driver are all guarded by the
STAGING Kconfig symbol).

Thierry
diff mbox

Patch

diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index c15d781..5391780 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -36,7 +36,8 @@  struct drm_tegra_gem_create {
 
 struct drm_tegra_gem_mmap {
 	__u32 handle;
-	__u32 offset;
+	__u32 pad;
+	__u64 offset;
 };
 
 struct drm_tegra_syncpt_read {