summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-09 16:23:22 -0800
committerKeith Packard <keithp@keithp.com>2011-03-23 17:14:12 -0700
commitaa0328f342177e33f9c863531712eaa4577b5f2b (patch)
tree915b6b5e2651da11f5f1430ad4eb7b9780690a0c /src
parentee740778f5d5355c04f6fc4564f598993b106d62 (diff)
dri2: Make DRI2FrameEvent public and use instead of void *
Instead of using void * for all of the flip_info and swap_info pointers, just make the underlying structure a public data type and use that. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/intel.h25
-rw-r--r--src/intel_display.c14
-rw-r--r--src/intel_dri.c24
3 files changed, 31 insertions, 32 deletions
diff --git a/src/intel.h b/src/intel.h
index d2a553f1..711449a5 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -464,9 +464,28 @@ extern int intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crt
extern int intel_crtc_id(xf86CrtcPtr crtc);
extern int intel_output_dpms_status(xf86OutputPtr output);
+enum DRI2FrameEventType {
+ DRI2_SWAP,
+ DRI2_FLIP,
+ DRI2_WAITMSC,
+};
+
+typedef struct _DRI2FrameEvent {
+ XID drawable_id;
+ ClientPtr client;
+ enum DRI2FrameEventType type;
+ int frame;
+
+ /* for swaps & flips only */
+ DRI2SwapEventPtr event_complete;
+ void *event_data;
+ DRI2BufferPtr front;
+ DRI2BufferPtr back;
+} DRI2FrameEventRec, *DRI2FrameEventPtr;
+
extern Bool intel_do_pageflip(intel_screen_private *intel,
dri_bo *new_front,
- void *data, int ref_crtc_hw_id);
+ DRI2FrameEventPtr flip_info, int ref_crtc_hw_id);
static inline intel_screen_private *
intel_get_screen_private(ScrnInfoPtr scrn)
@@ -500,9 +519,9 @@ extern xf86CrtcPtr intel_covering_crtc(ScrnInfoPtr scrn, BoxPtr box,
Bool I830DRI2ScreenInit(ScreenPtr pScreen);
void I830DRI2CloseScreen(ScreenPtr pScreen);
void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
- unsigned int tv_usec, void *user_data);
+ unsigned int tv_usec, DRI2FrameEventPtr flip_info);
void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
- unsigned int tv_usec, void *user_data);
+ unsigned int tv_usec, DRI2FrameEventPtr flip_info);
extern Bool intel_crtc_on(xf86CrtcPtr crtc);
int intel_crtc_to_pipe(xf86CrtcPtr crtc);
diff --git a/src/intel_display.c b/src/intel_display.c
index f487a6e5..eb07cf56 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -50,7 +50,7 @@ struct intel_mode {
int cpp;
drmEventContext event_context;
- void *event_data;
+ DRI2FrameEventPtr flip_info;
int old_fb_id;
int flip_count;
unsigned int fe_frame;
@@ -1428,7 +1428,7 @@ fail:
Bool
intel_do_pageflip(intel_screen_private *intel,
dri_bo *new_front,
- void *data, int ref_crtc_hw_id)
+ DRI2FrameEventPtr flip_info, int ref_crtc_hw_id)
{
ScrnInfoPtr scrn = intel->scrn;
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -1464,7 +1464,7 @@ intel_do_pageflip(intel_screen_private *intel,
if (!config->crtc[i]->enabled)
continue;
- mode->event_data = data;
+ mode->flip_info = flip_info;
mode->flip_count++;
crtc = config->crtc[i]->driver_private;
@@ -1512,9 +1512,9 @@ static const xf86CrtcConfigFuncsRec intel_xf86crtc_config_funcs = {
static void
intel_vblank_handler(int fd, unsigned int frame, unsigned int tv_sec,
- unsigned int tv_usec, void *event_data)
+ unsigned int tv_usec, DRI2FrameEventPtr event)
{
- I830DRI2FrameEventHandler(frame, tv_sec, tv_usec, event_data);
+ I830DRI2FrameEventHandler(frame, tv_sec, tv_usec, event);
}
static void
@@ -1541,12 +1541,12 @@ intel_page_flip_handler(int fd, unsigned int frame, unsigned int tv_sec,
/* Release framebuffer */
drmModeRmFB(mode->fd, mode->old_fb_id);
- if (mode->event_data == NULL)
+ if (mode->flip_info == NULL)
return;
/* Deliver cached msc, ust from reference crtc to flip event handler */
I830DRI2FlipEventHandler(mode->fe_frame, mode->fe_tv_sec,
- mode->fe_tv_usec, mode->event_data);
+ mode->fe_tv_usec, mode->flip_info);
}
static void
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 7449232f..9e8c3705 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -553,24 +553,6 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
#if DRI2INFOREC_VERSION >= 4
-enum DRI2FrameEventType {
- DRI2_SWAP,
- DRI2_FLIP,
- DRI2_WAITMSC,
-};
-
-typedef struct _DRI2FrameEvent {
- XID drawable_id;
- ClientPtr client;
- enum DRI2FrameEventType type;
- int frame;
-
- /* for swaps & flips only */
- DRI2SwapEventPtr event_complete;
- void *event_data;
- DRI2BufferPtr front;
- DRI2BufferPtr back;
-} DRI2FrameEventRec, *DRI2FrameEventPtr;
static int
I830DRI2DrawablePipe(DrawablePtr pDraw)
@@ -700,9 +682,8 @@ can_exchange(DRI2BufferPtr front, DRI2BufferPtr back)
}
void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
- unsigned int tv_usec, void *event_data)
+ unsigned int tv_usec, DRI2FrameEventPtr event)
{
- DRI2FrameEventPtr event = event_data;
DrawablePtr drawable;
ScreenPtr screen;
ScrnInfoPtr scrn;
@@ -781,9 +762,8 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
}
void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
- unsigned int tv_usec, void *event_data)
+ unsigned int tv_usec, DRI2FrameEventPtr flip)
{
- DRI2FrameEventPtr flip = event_data;
DrawablePtr drawable;
ScreenPtr screen;
ScrnInfoPtr scrn;