add -Wall, cleanup warnings

This commit is contained in:
Dave Airlie 2011-09-29 14:13:58 +01:00
parent a4f6e661b5
commit d686130c17
2 changed files with 10 additions and 32 deletions

View File

@ -33,6 +33,7 @@
#include "config.h"
#endif
#include <unistd.h>
#include <fcntl.h>
#include "xf86.h"
#include "xf86_OSproc.h"
@ -199,8 +200,6 @@ ms_pci_probe(DriverPtr driver,
int entity_num, struct pci_device *dev, intptr_t match_data)
{
ScrnInfoPtr scrn = NULL;
EntityInfoPtr entity;
DevUnion *private;
scrn = xf86ConfigPciEntity(scrn, 0, entity_num, NULL,
NULL, NULL, NULL, NULL, NULL);
@ -239,14 +238,11 @@ ms_pci_probe(DriverPtr driver,
static Bool
Probe(DriverPtr drv, int flags)
{
int i, numUsed, numDevSections, *usedChips;
EntPtr msEnt = NULL;
DevUnion *pPriv;
int i, numDevSections;
GDevPtr *devSections;
Bool foundScreen = FALSE;
int numDevs;
char *dev;
ScrnInfoPtr scrn;
ScrnInfoPtr scrn = NULL;
/* For now, just bail out for PROBE_DETECT. */
if (flags & PROBE_DETECT)
@ -268,7 +264,7 @@ Probe(DriverPtr drv, int flags)
int entity;
entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
scrn = xf86ConfigFbEntity(scrn, 0, entity,
NULL, NULL, NULL, NULL);
NULL, NULL, NULL, NULL);
}
if (scrn)
@ -376,17 +372,11 @@ FreeRec(ScrnInfoPtr pScrn)
static Bool
PreInit(ScrnInfoPtr pScrn, int flags)
{
xf86CrtcConfigPtr xf86_config;
modesettingPtr ms;
MessageType from = X_PROBED;
rgb defaultWeight = { 0, 0, 0 };
EntityInfoPtr pEnt;
EntPtr msEnt = NULL;
char *BusID;
int i;
char *s;
int num_pipe;
int max_width, max_height;
if (pScrn->numEntities != 1)
return FALSE;
@ -526,7 +516,6 @@ CreateScreenResources(ScreenPtr pScreen)
modesettingPtr ms = modesettingPTR(pScrn);
PixmapPtr rootPixmap;
Bool ret;
int flags;
void *pixels;
pScreen->CreateScreenResources = ms->createScreenResources;
ret = pScreen->CreateScreenResources(pScreen);
@ -567,9 +556,6 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
modesettingPtr ms = modesettingPTR(pScrn);
VisualPtr visual;
unsigned long sys_mem;
int c;
MessageType from;
int ret;
ErrorF("ms is %p\n", ms);

View File

@ -108,11 +108,13 @@ static int dumb_bo_map(int fd, struct dumb_bo *bo)
return 0;
}
#if 0
static int dumb_bo_unmap(int fd, struct dumb_bo *bo)
{
bo->map_count--;
return 0;
}
#endif
static int dumb_bo_destroy(int fd, struct dumb_bo *bo)
{
@ -260,7 +262,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
Rotation rotation, int x, int y)
{
ScrnInfoPtr pScrn = crtc->scrn;
// RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
@ -273,11 +274,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
int i;
int fb_id;
drmModeModeInfo kmode;
int pitch;
uint32_t tiling_flags = 0;
int height;
pitch = pScrn->displayWidth;
height = pScrn->virtualY;
if (drmmode->fb_id == 0) {
@ -795,7 +793,6 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num, int *num_dv
drmModePropertyPtr props;
char name[32];
int i;
const char *s;
koutput = drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]);
if (!koutput)
@ -938,10 +935,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
uint32_t old_fb_id;
int i, pitch, old_width, old_height, old_pitch;
int screen_size;
int cpp = (scrn->bitsPerPixel + 1) / 8;
struct dumb_bo *front_bo;
uint32_t tiling_flags = 0;
PixmapPtr ppix = screen->GetScreenPixmap(screen);
void *new_pixels;
@ -949,12 +943,12 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
return TRUE;
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Allocate new frame buffer %dx%d stride %d\n",
width, height, pitch / cpp);
"Allocate new frame buffer %dx%d stride\n",
width, height);
old_width = scrn->virtualX;
old_height = scrn->virtualY;
old_pitch = scrn->displayWidth;
old_pitch = drmmode->front_bo->pitch;
old_fb_id = drmmode->fb_id;
old_front = drmmode->front_bo;
@ -1009,7 +1003,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
drmmode->front_bo = old_front;
scrn->virtualX = old_width;
scrn->virtualY = old_height;
scrn->displayWidth = old_pitch;
scrn->displayWidth = old_pitch / cpp;
drmmode->fb_id = old_fb_id;
return FALSE;
@ -1021,11 +1015,9 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
{
xf86CrtcConfigPtr xf86_config;
int i, num_dvi = 0, num_hdmi = 0;
xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
drmmode->scrn = pScrn;
drmmode->cpp = cpp;