Pekka Paalanen
2009-Aug-08 07:38 UTC
[Nouveau] [PATCH 1/7] drm/nouveau: sparse cleanups for undeclared vs. static
Module parameters declarations moved to nouveau_drv.h. Ioctl table declarations moved to nouveau_drv.h. nouveau_ioc32.c: include nouveau_drv.h for nouveau_compat_ioctl(). Signed-off-by: Pekka Paalanen <pq at iki.fi> --- drivers/gpu/drm/nouveau/nouveau_bios.c | 3 --- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 -- drivers/gpu/drm/nouveau/nouveau_drv.c | 3 --- drivers/gpu/drm/nouveau/nouveau_drv.h | 9 +++++++++ drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 -- drivers/gpu/drm/nouveau/nouveau_ioc32.c | 2 +- drivers/gpu/drm/nouveau/nouveau_mem.c | 2 -- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index d61e717..d3f052a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -3249,9 +3249,6 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b return 0; } -extern int nouveau_uscript_lvds; -extern int nouveau_uscript_tmds; - int nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, int pxclk) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 5015f75..c89bef7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -34,8 +34,6 @@ #include "nouveau_connector.h" #include "nouveau_hw.h" -extern int nouveau_duallink; - static struct nouveau_encoder * nouveau_connector_encoder_get(struct drm_connector *connector, int type) { diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index c9b169f..bdee0dc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c @@ -277,9 +277,6 @@ nouveau_pci_resume(struct pci_dev *pdev) return 0; } -extern struct drm_ioctl_desc nouveau_ioctls[]; -extern int nouveau_max_ioctl; - static struct drm_driver driver = { .driver_features DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 25510b3..fa89b14 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -606,6 +606,13 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo) (ch) = nv->fifos[(id)]; \ } while(0) +/* nouveau_drv.c */ +extern int nouveau_noagp; +extern int nouveau_duallink; +extern int nouveau_uscript_lvds; +extern int nouveau_uscript_tmds; +extern int nouveau_fbpercrtc; + /* nouveau_state.c */ extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern int nouveau_load(struct drm_device *, unsigned long flags); @@ -658,6 +665,8 @@ extern int nouveau_ioctl_notifier_free(struct drm_device *, void *data, struct drm_file *); /* nouveau_fifo.c */ +extern struct drm_ioctl_desc nouveau_ioctls[]; +extern int nouveau_max_ioctl; extern int nouveau_fifo_init(struct drm_device *); extern int nouveau_fifo_ctx_size(struct drm_device *); extern void nouveau_fifo_cleanup(struct drm_device *, struct drm_file *); diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 601eabe..bc229cb 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -47,8 +47,6 @@ #include "nouveau_fbcon.h" #include "nouveau_dma.h" -extern int nouveau_fbpercrtc; - static int nouveau_fbcon_sync(struct fb_info *info) { diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c b/drivers/gpu/drm/nouveau/nouveau_ioc32.c index f55ae7a..a2c30f4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c +++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c @@ -36,7 +36,7 @@ #include "drmP.h" #include "drm.h" -#include "nouveau_drm.h" +#include "nouveau_drv.h" /** * Called whenever a 32-bit process running under a 64-bit kernel diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index ff473c5..01160fe 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -35,8 +35,6 @@ #include "drm_sarea.h" #include "nouveau_drv.h" -extern int nouveau_noagp; - static struct mem_block * split_block(struct mem_block *p, uint64_t start, uint64_t size, struct drm_file *file_priv) -- 1.6.3.3
Pekka Paalanen
2009-Aug-08 07:38 UTC
[Nouveau] [PATCH 2/7] drm/nouveau: collect switch blocks in nouveau_fbcon.c
The two large switch blocks are refactored into a function. While doing this, some inconsistencies are corrected: - in nouveau_fbcon_check_var(), case 30 was writing to a wrong structure. - in nouveau_fbcon_create(), case 16 was missing transp.length. Signed-off-by: Pekka Paalanen <pq at iki.fi> --- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 156 ++++++++++--------------------- 1 files changed, 51 insertions(+), 105 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index bc229cb..7ccadc0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -153,46 +153,15 @@ static int nouveau_fbcon_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -static int nouveau_fbcon_check_var(struct fb_var_screeninfo *var, - struct fb_info *info) +static int nouveau_fbcon_set_color_fields(int depth, + struct fb_var_screeninfo *var) { - struct nouveau_fbcon_par *par = info->par; - struct nouveau_framebuffer *nouveau_fb = par->nouveau_fb; - struct drm_device *dev = par->dev; - struct drm_framebuffer *fb = &nouveau_fb->base; - int depth; - - /* Need to resize the fb object !!! */ - if (var->xres > fb->width || var->yres > fb->height) { - NV_ERROR(dev, "Requested width/height is greater than current fb object %dx%d > %dx%d\n",var->xres,var->yres,fb->width,fb->height); - NV_ERROR(dev, "Need resizing code.\n"); - return -EINVAL; - } - - switch (var->bits_per_pixel) { - case 16: - depth = (var->green.length == 6) ? 16 : 15; - break; - case 32: - if (var->transp.length == 2) - depth = 30; - else - if (var->transp.length > 0) - depth = 32; - else - depth = 24; - break; - default: - depth = var->bits_per_pixel; - break; - } - switch (depth) { case 8: var->red.offset = 0; var->green.offset = 0; var->blue.offset = 0; - var->red.length = 8; + var->red.length = 8; /* 8-bit DAC */ var->green.length = 8; var->blue.length = 8; var->transp.length = 0; @@ -229,14 +198,14 @@ static int nouveau_fbcon_check_var(struct fb_var_screeninfo *var, var->transp.offset = 0; break; case 30: - info->var.red.offset = 0; - info->var.green.offset = 10; - info->var.blue.offset = 20; - info->var.red.length = 10; - info->var.green.length = 10; - info->var.blue.length = 10; - info->var.transp.offset = 30; - info->var.transp.length = 2; + var->red.offset = 0; + var->green.offset = 10; + var->blue.offset = 20; + var->red.length = 10; + var->green.length = 10; + var->blue.length = 10; + var->transp.offset = 30; + var->transp.length = 2; break; case 32: var->red.offset = 16; @@ -251,6 +220,45 @@ static int nouveau_fbcon_check_var(struct fb_var_screeninfo *var, default: return -EINVAL; } + return 0; +} + +static int nouveau_fbcon_check_var(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + struct nouveau_fbcon_par *par = info->par; + struct nouveau_framebuffer *nouveau_fb = par->nouveau_fb; + struct drm_device *dev = par->dev; + struct drm_framebuffer *fb = &nouveau_fb->base; + int depth; + + /* Need to resize the fb object !!! */ + if (var->xres > fb->width || var->yres > fb->height) { + NV_ERROR(dev, "Requested width/height is greater than current fb object %dx%d > %dx%d\n",var->xres,var->yres,fb->width,fb->height); + NV_ERROR(dev, "Need resizing code.\n"); + return -EINVAL; + } + + switch (var->bits_per_pixel) { + case 16: + depth = (var->green.length == 6) ? 16 : 15; + break; + case 32: + if (var->transp.length == 2) + depth = 30; + else + if (var->transp.length > 0) + depth = 32; + else + depth = 24; + break; + default: + depth = var->bits_per_pixel; + break; + } + + if (nouveau_fbcon_set_color_fields(depth, var)) + return -EINVAL; return 0; } @@ -606,69 +614,7 @@ static int nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, info->pixmap.flags = FB_PIXMAP_SYSTEM; info->pixmap.scan_align = 1; - switch(fb->depth) { - case 8: - info->var.red.offset = 0; - info->var.green.offset = 0; - info->var.blue.offset = 0; - info->var.red.length = 8; /* 8bit DAC */ - info->var.green.length = 8; - info->var.blue.length = 8; - info->var.transp.offset = 0; - info->var.transp.length = 0; - break; - case 15: - info->var.red.offset = 10; - info->var.green.offset = 5; - info->var.blue.offset = 0; - info->var.red.length = 5; - info->var.green.length = 5; - info->var.blue.length = 5; - info->var.transp.offset = 15; - info->var.transp.length = 1; - break; - case 16: - info->var.red.offset = 11; - info->var.green.offset = 5; - info->var.blue.offset = 0; - info->var.red.length = 5; - info->var.green.length = 6; - info->var.blue.length = 5; - info->var.transp.offset = 0; - break; - case 24: - info->var.red.offset = 16; - info->var.green.offset = 8; - info->var.blue.offset = 0; - info->var.red.length = 8; - info->var.green.length = 8; - info->var.blue.length = 8; - info->var.transp.offset = 0; - info->var.transp.length = 0; - break; - case 30: - info->var.red.offset = 0; - info->var.green.offset = 10; - info->var.blue.offset = 20; - info->var.red.length = 10; - info->var.green.length = 10; - info->var.blue.length = 10; - info->var.transp.offset = 30; - info->var.transp.length = 2; - break; - case 32: - info->var.red.offset = 16; - info->var.green.offset = 8; - info->var.blue.offset = 0; - info->var.red.length = 8; - info->var.green.length = 8; - info->var.blue.length = 8; - info->var.transp.offset = 24; - info->var.transp.length = 8; - break; - default: - break; - } + nouveau_fbcon_set_color_fields(fb->depth, &info->var); fb->fbdev = info; -- 1.6.3.3
Pekka Paalanen
2009-Aug-08 07:38 UTC
[Nouveau] [PATCH 3/7] drm/nouveau: FB_ACCEL_I830 in fbcon is wrong
fb_info::fix.accel field tells user space what kind of accelerations it can do via the framebuffer interface. Nouveau is definitely not i830, so set the field to FB_ACCEL_NONE. In the DRM world we have a lot better APIs for accelerated graphics. Cc: Dave Airlie <airlied at redhat.com> Signed-off-by: Pekka Paalanen <pq at iki.fi> --- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 7ccadc0..228e763 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -575,7 +575,7 @@ static int nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, info->fix.xpanstep = 1; /* doing it in hw */ info->fix.ypanstep = 1; /* doing it in hw */ info->fix.ywrapstep = 0; - info->fix.accel = FB_ACCEL_I830; + info->fix.accel = FB_ACCEL_NONE; info->fix.type_aux = 0; info->fbops = &nouveau_fbcon_ops; -- 1.6.3.3
Pekka Paalanen
2009-Aug-08 07:38 UTC
[Nouveau] [PATCH 4/7] drm/nouveau: convert struct down-cast macros to funcs
Turn macros, that cast parent class struct pointers to child class struct pointers, into static inline functions. Inline functions provide a little more type safety than the conversion macros, especially as several structs have the same parent member name. Fixes one sparse warning. Unfortunately, the same name cannot be at the same time a struct name, a function name and a variable name. Therefore some renames in nouveau_fbcon.c are necessary. The macro nouveau_fdev() is not used and references to a member that does not exist. The macro is removed. Signed-off-by: Pekka Paalanen <pq at iki.fi> --- drivers/gpu/drm/nouveau/nouveau_connector.h | 7 +++++- drivers/gpu/drm/nouveau/nouveau_crtc.h | 6 ++++- drivers/gpu/drm/nouveau/nouveau_drv.h | 12 +++++----- drivers/gpu/drm/nouveau/nouveau_encoder.h | 6 ++++- drivers/gpu/drm/nouveau/nouveau_fb.h | 6 ++++- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 28 +++++++++++++------------- 6 files changed, 41 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h index cc6369f..0d314df 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.h +++ b/drivers/gpu/drm/nouveau/nouveau_connector.h @@ -45,7 +45,12 @@ struct nouveau_connector { struct edid *edid; }; -#define nouveau_connector(x) container_of((x), struct nouveau_connector, base) + +static inline struct nouveau_connector *nouveau_connector( + struct drm_connector *con) +{ + return container_of(con, struct nouveau_connector, base); +} int nouveau_connector_create(struct drm_device *dev, int i2c_index, int type); diff --git a/drivers/gpu/drm/nouveau/nouveau_crtc.h b/drivers/gpu/drm/nouveau/nouveau_crtc.h index c6a12b3..7b26c17 100644 --- a/drivers/gpu/drm/nouveau/nouveau_crtc.h +++ b/drivers/gpu/drm/nouveau/nouveau_crtc.h @@ -70,7 +70,11 @@ struct nouveau_crtc { int (*set_dither)(struct nouveau_crtc *crtc, bool on, bool update); int (*set_scale)(struct nouveau_crtc *crtc, int mode, bool update); }; -#define nouveau_crtc(x) container_of((x), struct nouveau_crtc, base) + +static inline struct nouveau_crtc *nouveau_crtc(struct drm_crtc *crtc) +{ + return container_of(crtc, struct nouveau_crtc, base); +} int nv50_crtc_create(struct drm_device *dev, int index); int nv50_cursor_init(struct nouveau_crtc *); diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index fa89b14..381cadd 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -51,12 +51,6 @@ struct nouveau_fpriv { #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) -#define nouveau_bdev(_bd) \ - container_of(_bd, struct drm_nouveau_private, ttm.bdev) - -#define nouveau_fdev(_fd) \ - container_of(_fd, struct drm_nouveau_private, ttm.fdev) - #include "nouveau_drm.h" #include "nouveau_reg.h" #include "nouveau_bios.h" @@ -569,6 +563,12 @@ struct drm_nouveau_private { struct nouveau_channel *evo; }; +static inline struct drm_nouveau_private * +nouveau_bdev(struct ttm_bo_device *bd) +{ + return container_of(bd, struct drm_nouveau_private, ttm.bdev); +} + static inline int nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo) { diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h index c4846a9..3344e6c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_encoder.h +++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h @@ -41,7 +41,11 @@ struct nouveau_encoder { struct nv04_output_reg restore; }; -#define nouveau_encoder(x) container_of((x), struct nouveau_encoder, base) + +static inline struct nouveau_encoder *nouveau_encoder(struct drm_encoder *enc) +{ + return container_of(enc, struct nouveau_encoder, base); +} int nv50_sor_create(struct drm_device *dev, struct dcb_entry *entry); int nv50_dac_create(struct drm_device *dev, struct dcb_entry *entry); diff --git a/drivers/gpu/drm/nouveau/nouveau_fb.h b/drivers/gpu/drm/nouveau/nouveau_fb.h index 1101d1d..4a3f31a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fb.h +++ b/drivers/gpu/drm/nouveau/nouveau_fb.h @@ -32,7 +32,11 @@ struct nouveau_framebuffer { struct nouveau_bo *nvbo; }; -#define nouveau_framebuffer(x) container_of((x), struct nouveau_framebuffer, base) +static inline struct nouveau_framebuffer * +nouveau_framebuffer(struct drm_framebuffer *fb) +{ + return container_of(fb, struct nouveau_framebuffer, base); +} extern const struct drm_mode_config_funcs nouveau_mode_config_funcs; diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 228e763..df317a4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -104,8 +104,8 @@ static int nouveau_fbcon_setcolreg(unsigned regno, unsigned red, unsigned green, int i; list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { - struct nouveau_crtc *nouveau_crtc = nouveau_crtc(crtc); - struct drm_mode_set *modeset = &nouveau_crtc->mode_set; + struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); + struct drm_mode_set *modeset = &nv_crtc->mode_set; struct drm_framebuffer *fb = modeset->fb; for (i = 0; i < par->crtc_count; i++) @@ -283,7 +283,7 @@ static int nouveau_fbcon_set_par(struct fb_info *info) int ret; list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { - struct nouveau_crtc *nouveau_crtc = nouveau_crtc(crtc); + struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); for (i = 0; i < par->crtc_count; i++) if (crtc->base.id == par->crtc_ids[i]) @@ -292,9 +292,9 @@ static int nouveau_fbcon_set_par(struct fb_info *info) if (i == par->crtc_count) continue; - if (crtc->fb == nouveau_crtc->mode_set.fb) { + if (crtc->fb == nv_crtc->mode_set.fb) { mutex_lock(&dev->mode_config.mutex); - ret = crtc->funcs->set_config(&nouveau_crtc->mode_set); + ret = crtc->funcs->set_config(&nv_crtc->mode_set); mutex_unlock(&dev->mode_config.mutex); if (ret) return ret; @@ -311,7 +311,7 @@ static int nouveau_fbcon_pan_display(struct fb_var_screeninfo *var, struct drm_device *dev = par->dev; struct drm_mode_set *modeset; struct drm_crtc *crtc; - struct nouveau_crtc *nouveau_crtc; + struct nouveau_crtc *nv_crtc; int ret = 0; int i; @@ -323,8 +323,8 @@ static int nouveau_fbcon_pan_display(struct fb_var_screeninfo *var, if (i == par->crtc_count) continue; - nouveau_crtc = nouveau_crtc(crtc); - modeset = &nouveau_crtc->mode_set; + nv_crtc = nouveau_crtc(crtc); + modeset = &nv_crtc->mode_set; modeset->x = var->xoffset; modeset->y = var->yoffset; @@ -657,7 +657,7 @@ out: static int nouveau_fbcon_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc *crtc) { - struct nouveau_crtc *nouveau_crtc = nouveau_crtc(crtc); + struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_framebuffer *nouveau_fb; struct drm_framebuffer *fb; struct drm_connector *connector; @@ -678,13 +678,13 @@ static int nouveau_fbcon_multi_fb_probe_crtc(struct drm_device *dev, height = crtc->desired_mode->vdisplay; /* is there an fb bound to this crtc already */ - if (!nouveau_crtc->mode_set.fb) { + if (!nv_crtc->mode_set.fb) { ret = nouveau_fbcon_create(dev, width, height, width, height, &nouveau_fb); if (ret) return -EINVAL; new_fb = 1; } else { - fb = nouveau_crtc->mode_set.fb; + fb = nv_crtc->mode_set.fb; nouveau_fb = nouveau_framebuffer(fb); if ((nouveau_fb->base.width < width) || (nouveau_fb->base.height < height)) return -EINVAL; @@ -693,7 +693,7 @@ static int nouveau_fbcon_multi_fb_probe_crtc(struct drm_device *dev, info = nouveau_fb->base.fbdev; par = info->par; - modeset = &nouveau_crtc->mode_set; + modeset = &nv_crtc->mode_set; modeset->fb = &nouveau_fb->base; conn_count = 0; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -841,9 +841,9 @@ static int nouveau_fbcon_single_fb_probe(struct drm_device *dev) * set configuration. */ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { - struct nouveau_crtc *nouveau_crtc = nouveau_crtc(crtc); + struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - modeset = &nouveau_crtc->mode_set; + modeset = &nv_crtc->mode_set; modeset->fb = &nouveau_fb->base; conn_count = 0; list_for_each_entry(connector, &dev->mode_config.connector_list, -- 1.6.3.3
Pekka Paalanen
2009-Aug-08 07:39 UTC
[Nouveau] [PATCH 5/7] drm/nouveau: use PTR_ERR instead of a cast
A small cleanup in using the ERR_PTR API. Signed-off-by: Pekka Paalanen <pq at iki.fi> --- drivers/gpu/drm/nouveau/nouveau_gem.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 670348b..bbef95d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -482,19 +482,19 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, pushbuf = u_memcpya(req->dwords, req->nr_dwords, sizeof(uint32_t)); if (IS_ERR(pushbuf)) - return (unsigned long)pushbuf; + return PTR_ERR(pushbuf); bo = u_memcpya(req->buffers, req->nr_buffers, sizeof(*bo)); if (IS_ERR(bo)) { kfree(pushbuf); - return (unsigned long)bo; + return PTR_ERR(bo); } reloc = u_memcpya(req->relocs, req->nr_relocs, sizeof(*reloc)); if (IS_ERR(reloc)) { kfree(bo); kfree(pushbuf); - return (unsigned long)reloc; + return PTR_ERR(reloc); } mutex_lock(&dev->struct_mutex); -- 1.6.3.3