Re: [git pull] drm fixes

Dave Airlie
2011-03-24T11:06:31Z

[-- Attachment #1: Type: text/plain, Size: 2208 bytes --]

2011/3/23 Michel Dänzer <michel@daenzer.net>:
> On Mit, 2011-03-23 at 06:40 -0500, Ilija Hadzic wrote:
>> On Wed, 23 Mar 2011, Dave Airlie wrote:
>>
>> > 2011/3/23 Michel Dänzer <michel@daenzer.net>:
>> >> On Mit, 2011-03-23 at 18:16 +1000, Dave Airlie wrote:
>> >>> 2011/3/23 Michel Dänzer <michel@daenzer.net>:
>> >>>> On Mit, 2011-03-23 at 04:18 +0000, Dave Airlie wrote:
>> >>>>>
>> >>>>> One radeon, 2 core fixes, and an interface update to allow for > 2 crtcs
>> >>>>> in vblank.
>> >>>>
>> >>>> [...]
>> >>>>
>> >>>>> Ilija Hadzic (1):
>> >>>>>       drm/kernel: vblank wait on crtc > 1
>> >>>>
>> >>>> This patch was still being debated yesterday, are you deliberately
>> >>>> pushing it regardless? Once it hits mainline, it'll be pretty much set
>> >>>> in stone.
>> >>>
>> >>> From what I can see it was the userspace patches being debated, this
>> >>> one seemed fine and the interface looked okay to me.
>> >>
>> >> The author ignored my suggestions to make the patch smaller and simpler,
>> >> more maintainable and more future-proof all at once.
>> >
>> > It was already small and I'm not sure merging the flags made it more
>> > maintainable. Its always
>> > being a slightly painful ioctl, and hopefully any future changes add a
>> > new ioctl esp if we want 64-bit values.
>> >
>> > The only comment I really thought was necessary was changing the CAP
>> > name, but since that isn't
>> > part of the ABI (just the number) we can quickly fix it with a follow-up.
>> >
>> > Dave.
>>
>> All of the issues debated yesterday, except one, boil down to renaming a
>> handful on #defines without changing the values nor interface nor behavior
>> of the kernel.
>
> No, one central point is not to leave two holes between
> _DRM_VBLANK_FLAGS_MASK, _DRM_VBLANK_HIGH_CRTC_MASK and
> _DRM_VBLANK_TYPES_MASK .

Okay I've pushed this to my tree before this discussion got on my
radar and I'm just catching up now.

I'll push the following patch to Linus to keep the biggest gap in the
32-bit word for future use, then
we can fixup the userspace patches.

Kernel interfaces aren't considered unchangeable usually on the kernel
is released.

Dave.

[-- Attachment #2: 0001-drm-vblank-update-recently-added-vbl-interface-to-be.patch --]
[-- Type: text/x-patch, Size: 2343 bytes --]

From 2fbd71354b13f31c6a408b6eedcefd4ee8d1d3fa Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 24 Mar 2011 20:54:35 +1000
Subject: [PATCH] drm/vblank: update recently added vbl interface to be more future proof.

This makes the interface a bit cleaner by leaving a single gap in the
vblank bit space instead of creating two gaps.

Suggestions from Michel on mailing list/irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/drm_ioctl.c | 2 +-
include/drm/drm.h | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 3617b4c..904d7e9 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -280,7 +280,7 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
if (dev->driver->dumb_create)
req->value = 1;
break;
- case DRM_CAP_HIGH_CRTC:
+ case DRM_CAP_VBLANK_HIGH_CRTC:
req->value = 1;
break;
default:
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 99cd074..4be33b4 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -463,14 +463,15 @@ struct drm_irq_busid {
enum drm_vblank_seq_type {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
+ /* bits 1-6 are reserved for high crtcs */
+ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e,
_DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */
_DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
_DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
_DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
_DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */
};
-#define _DRM_VBLANK_HIGH_CRTC_SHIFT 16
-#define _DRM_VBLANK_HIGH_CRTC_MASK 0x001F0000
+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1

#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
@@ -755,7 +756,7 @@ struct drm_event_vblank {
};

#define DRM_CAP_DUMB_BUFFER 0x1
-#define DRM_CAP_HIGH_CRTC 0x2
+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2

/* typedef area */
#ifndef __KERNEL__
--
1.7.1