summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-07-13 10:15:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-07-13 10:15:34 +0100
commitb2e98227d11a60e90b3ea518f14962f2764ffa68 (patch)
tree72674c1288ea16de9b1003fe809ac1ee7cda1820
parent5de1b74d64f807b59c730871d4cb171484db9780 (diff)
Remove the duplicate drmmode prototypes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/drmmode_display.c29
-rw-r--r--src/intel.h8
2 files changed, 15 insertions, 22 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e892dff9..546b8d59 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -126,6 +126,12 @@ static char *backlight_interfaces[] = {
/* Enough for 10 digits of backlight + '\n' + '\0' */
#define BACKLIGHT_VALUE_LEN 12
+static inline int
+crtc_id(drmmode_crtc_private_ptr drmmode_crtc)
+{
+ return drmmode_crtc->mode_crtc->crtc_id;
+}
+
static void
drmmode_backlight_set(xf86OutputPtr output, int level)
{
@@ -361,7 +367,7 @@ drmmode_apply(xf86CrtcPtr crtc)
x = 0;
y = 0;
}
- ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+ ret = drmModeSetCrtc(drmmode->fd, crtc_id(drmmode_crtc),
fb_id, x, y, output_ids, output_count,
&drmmode_crtc->kmode);
if (ret) {
@@ -452,7 +458,7 @@ drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
- drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y);
+ drmModeMoveCursor(drmmode->fd, crtc_id(drmmode_crtc), x, y);
}
static void
@@ -477,8 +483,7 @@ drmmode_hide_cursor (xf86CrtcPtr crtc)
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
- drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
- 0, 64, 64);
+ drmModeSetCursor(drmmode->fd, crtc_id(drmmode_crtc), 0, 64, 64);
}
static void
@@ -487,7 +492,7 @@ drmmode_show_cursor (xf86CrtcPtr crtc)
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
- drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+ drmModeSetCursor(drmmode->fd, crtc_id(drmmode_crtc),
drmmode_crtc->cursor->handle, 64, 64);
}
@@ -599,7 +604,7 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc,
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
- drmModeCrtcSetGamma(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+ drmModeCrtcSetGamma(drmmode->fd, crtc_id(drmmode_crtc),
size, red, green, blue);
}
@@ -1364,7 +1369,6 @@ drmmode_do_pageflip(ScreenPtr screen, dri_bo *new_front, void *data)
drmmode_ptr drmmode = drmmode_crtc->drmmode;
unsigned int pitch = scrn->displayWidth * intel->cpp;
int i, old_fb_id;
- unsigned int crtc_id;
/*
* Create a new handle for the back buffer
@@ -1391,10 +1395,9 @@ drmmode_do_pageflip(ScreenPtr screen, dri_bo *new_front, void *data)
continue;
drmmode_crtc = crtc->driver_private;
- crtc_id = drmmode_crtc->mode_crtc->crtc_id;
drmmode->event_data = data;
drmmode->flip_count++;
- if (drmModePageFlip(drmmode->fd, crtc_id, drmmode->fb_id,
+ if (drmModePageFlip(drmmode->fd, crtc_id(drmmode_crtc), drmmode->fb_id,
DRM_MODE_PAGE_FLIP_EVENT, drmmode)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"flip queue failed: %s\n", strerror(errno));
@@ -1549,16 +1552,12 @@ drmmode_fini(intel_screen_private *intel)
int
drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc)
{
- drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-
- return drm_intel_get_pipe_from_crtc_id (bufmgr, drmmode_crtc->mode_crtc->crtc_id);
+ return drm_intel_get_pipe_from_crtc_id (bufmgr, crtc_id(crtc->driver_private));
}
/* for the drmmode overlay */
int
drmmode_crtc_id(xf86CrtcPtr crtc)
{
- drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-
- return drmmode_crtc->mode_crtc->crtc_id;
+ return crtc_id(crtc->driver_private);
}
diff --git a/src/intel.h b/src/intel.h
index 2f43b0e9..26cb96a9 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -440,6 +440,7 @@ extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
extern void drmmode_remove_fb(intel_screen_private *intel);
extern void drmmode_fini(intel_screen_private *intel);
extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc);
+extern int drmmode_crtc_id(xf86CrtcPtr crtc);
extern int drmmode_output_dpms_status(xf86OutputPtr output);
extern Bool drmmode_do_pageflip(ScreenPtr screen, dri_bo *new_front, void *data);
@@ -481,13 +482,6 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec,
void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
unsigned int tv_usec, void *user_data);
-extern Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp);
-extern void drmmode_closefb(ScrnInfoPtr scrn);
-extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr * bufmgr,
- xf86CrtcPtr crtc);
-extern int drmmode_output_dpms_status(xf86OutputPtr output);
-extern int drmmode_crtc_id(xf86CrtcPtr crtc);
-
extern Bool intel_crtc_on(xf86CrtcPtr crtc);
extern int intel_crtc_to_pipe(xf86CrtcPtr crtc);