add -Wall, cleanup warnings
This commit is contained in:
parent
a4f6e661b5
commit
d686130c17
|
@ -33,6 +33,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
#include "xf86_OSproc.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)
|
int entity_num, struct pci_device *dev, intptr_t match_data)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr scrn = NULL;
|
ScrnInfoPtr scrn = NULL;
|
||||||
EntityInfoPtr entity;
|
|
||||||
DevUnion *private;
|
|
||||||
|
|
||||||
scrn = xf86ConfigPciEntity(scrn, 0, entity_num, NULL,
|
scrn = xf86ConfigPciEntity(scrn, 0, entity_num, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL, NULL);
|
||||||
|
@ -239,14 +238,11 @@ ms_pci_probe(DriverPtr driver,
|
||||||
static Bool
|
static Bool
|
||||||
Probe(DriverPtr drv, int flags)
|
Probe(DriverPtr drv, int flags)
|
||||||
{
|
{
|
||||||
int i, numUsed, numDevSections, *usedChips;
|
int i, numDevSections;
|
||||||
EntPtr msEnt = NULL;
|
|
||||||
DevUnion *pPriv;
|
|
||||||
GDevPtr *devSections;
|
GDevPtr *devSections;
|
||||||
Bool foundScreen = FALSE;
|
Bool foundScreen = FALSE;
|
||||||
int numDevs;
|
|
||||||
char *dev;
|
char *dev;
|
||||||
ScrnInfoPtr scrn;
|
ScrnInfoPtr scrn = NULL;
|
||||||
|
|
||||||
/* For now, just bail out for PROBE_DETECT. */
|
/* For now, just bail out for PROBE_DETECT. */
|
||||||
if (flags & PROBE_DETECT)
|
if (flags & PROBE_DETECT)
|
||||||
|
@ -268,7 +264,7 @@ Probe(DriverPtr drv, int flags)
|
||||||
int entity;
|
int entity;
|
||||||
entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
|
entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
|
||||||
scrn = xf86ConfigFbEntity(scrn, 0, entity,
|
scrn = xf86ConfigFbEntity(scrn, 0, entity,
|
||||||
NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scrn)
|
if (scrn)
|
||||||
|
@ -376,17 +372,11 @@ FreeRec(ScrnInfoPtr pScrn)
|
||||||
static Bool
|
static Bool
|
||||||
PreInit(ScrnInfoPtr pScrn, int flags)
|
PreInit(ScrnInfoPtr pScrn, int flags)
|
||||||
{
|
{
|
||||||
xf86CrtcConfigPtr xf86_config;
|
|
||||||
modesettingPtr ms;
|
modesettingPtr ms;
|
||||||
MessageType from = X_PROBED;
|
|
||||||
rgb defaultWeight = { 0, 0, 0 };
|
rgb defaultWeight = { 0, 0, 0 };
|
||||||
EntityInfoPtr pEnt;
|
EntityInfoPtr pEnt;
|
||||||
EntPtr msEnt = NULL;
|
EntPtr msEnt = NULL;
|
||||||
char *BusID;
|
char *BusID;
|
||||||
int i;
|
|
||||||
char *s;
|
|
||||||
int num_pipe;
|
|
||||||
int max_width, max_height;
|
|
||||||
|
|
||||||
if (pScrn->numEntities != 1)
|
if (pScrn->numEntities != 1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -526,7 +516,6 @@ CreateScreenResources(ScreenPtr pScreen)
|
||||||
modesettingPtr ms = modesettingPTR(pScrn);
|
modesettingPtr ms = modesettingPTR(pScrn);
|
||||||
PixmapPtr rootPixmap;
|
PixmapPtr rootPixmap;
|
||||||
Bool ret;
|
Bool ret;
|
||||||
int flags;
|
|
||||||
void *pixels;
|
void *pixels;
|
||||||
pScreen->CreateScreenResources = ms->createScreenResources;
|
pScreen->CreateScreenResources = ms->createScreenResources;
|
||||||
ret = pScreen->CreateScreenResources(pScreen);
|
ret = pScreen->CreateScreenResources(pScreen);
|
||||||
|
@ -567,9 +556,6 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||||
modesettingPtr ms = modesettingPTR(pScrn);
|
modesettingPtr ms = modesettingPTR(pScrn);
|
||||||
VisualPtr visual;
|
VisualPtr visual;
|
||||||
unsigned long sys_mem;
|
|
||||||
int c;
|
|
||||||
MessageType from;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ErrorF("ms is %p\n", ms);
|
ErrorF("ms is %p\n", ms);
|
||||||
|
|
|
@ -108,11 +108,13 @@ static int dumb_bo_map(int fd, struct dumb_bo *bo)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int dumb_bo_unmap(int fd, struct dumb_bo *bo)
|
static int dumb_bo_unmap(int fd, struct dumb_bo *bo)
|
||||||
{
|
{
|
||||||
bo->map_count--;
|
bo->map_count--;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int dumb_bo_destroy(int fd, struct dumb_bo *bo)
|
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)
|
Rotation rotation, int x, int y)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = crtc->scrn;
|
ScrnInfoPtr pScrn = crtc->scrn;
|
||||||
// RADEONInfoPtr info = RADEONPTR(pScrn);
|
|
||||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
|
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
|
||||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||||
drmmode_ptr drmmode = drmmode_crtc->drmmode;
|
drmmode_ptr drmmode = drmmode_crtc->drmmode;
|
||||||
|
@ -273,11 +274,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
||||||
int i;
|
int i;
|
||||||
int fb_id;
|
int fb_id;
|
||||||
drmModeModeInfo kmode;
|
drmModeModeInfo kmode;
|
||||||
int pitch;
|
|
||||||
uint32_t tiling_flags = 0;
|
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
pitch = pScrn->displayWidth;
|
|
||||||
height = pScrn->virtualY;
|
height = pScrn->virtualY;
|
||||||
|
|
||||||
if (drmmode->fb_id == 0) {
|
if (drmmode->fb_id == 0) {
|
||||||
|
@ -795,7 +793,6 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num, int *num_dv
|
||||||
drmModePropertyPtr props;
|
drmModePropertyPtr props;
|
||||||
char name[32];
|
char name[32];
|
||||||
int i;
|
int i;
|
||||||
const char *s;
|
|
||||||
|
|
||||||
koutput = drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]);
|
koutput = drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]);
|
||||||
if (!koutput)
|
if (!koutput)
|
||||||
|
@ -938,10 +935,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
|
||||||
ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
|
ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
|
||||||
uint32_t old_fb_id;
|
uint32_t old_fb_id;
|
||||||
int i, pitch, old_width, old_height, old_pitch;
|
int i, pitch, old_width, old_height, old_pitch;
|
||||||
int screen_size;
|
|
||||||
int cpp = (scrn->bitsPerPixel + 1) / 8;
|
int cpp = (scrn->bitsPerPixel + 1) / 8;
|
||||||
struct dumb_bo *front_bo;
|
|
||||||
uint32_t tiling_flags = 0;
|
|
||||||
PixmapPtr ppix = screen->GetScreenPixmap(screen);
|
PixmapPtr ppix = screen->GetScreenPixmap(screen);
|
||||||
void *new_pixels;
|
void *new_pixels;
|
||||||
|
|
||||||
|
@ -949,12 +943,12 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
||||||
"Allocate new frame buffer %dx%d stride %d\n",
|
"Allocate new frame buffer %dx%d stride\n",
|
||||||
width, height, pitch / cpp);
|
width, height);
|
||||||
|
|
||||||
old_width = scrn->virtualX;
|
old_width = scrn->virtualX;
|
||||||
old_height = scrn->virtualY;
|
old_height = scrn->virtualY;
|
||||||
old_pitch = scrn->displayWidth;
|
old_pitch = drmmode->front_bo->pitch;
|
||||||
old_fb_id = drmmode->fb_id;
|
old_fb_id = drmmode->fb_id;
|
||||||
old_front = drmmode->front_bo;
|
old_front = drmmode->front_bo;
|
||||||
|
|
||||||
|
@ -1009,7 +1003,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
|
||||||
drmmode->front_bo = old_front;
|
drmmode->front_bo = old_front;
|
||||||
scrn->virtualX = old_width;
|
scrn->virtualX = old_width;
|
||||||
scrn->virtualY = old_height;
|
scrn->virtualY = old_height;
|
||||||
scrn->displayWidth = old_pitch;
|
scrn->displayWidth = old_pitch / cpp;
|
||||||
drmmode->fb_id = old_fb_id;
|
drmmode->fb_id = old_fb_id;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1021,11 +1015,9 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
|
||||||
|
|
||||||
Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
|
Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
|
||||||
{
|
{
|
||||||
xf86CrtcConfigPtr xf86_config;
|
|
||||||
int i, num_dvi = 0, num_hdmi = 0;
|
int i, num_dvi = 0, num_hdmi = 0;
|
||||||
|
|
||||||
xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
|
xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
|
||||||
xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
||||||
|
|
||||||
drmmode->scrn = pScrn;
|
drmmode->scrn = pScrn;
|
||||||
drmmode->cpp = cpp;
|
drmmode->cpp = cpp;
|
||||||
|
|
Loading…
Reference in New Issue