diff options
Diffstat (limited to 'drm')
-rw-r--r-- | drm/nouveau/dispnv04/crtc.c | 4 | ||||
-rw-r--r-- | drm/nouveau/dispnv04/dac.c | 4 | ||||
-rw-r--r-- | drm/nouveau/dispnv04/dfp.c | 4 | ||||
-rw-r--r-- | drm/nouveau/dispnv04/disp.c | 6 | ||||
-rw-r--r-- | drm/nouveau/dispnv04/tvnv04.c | 4 | ||||
-rw-r--r-- | drm/nouveau/dispnv04/tvnv17.c | 4 | ||||
-rw-r--r-- | drm/nouveau/nouveau_connector.c | 4 | ||||
-rw-r--r-- | drm/nouveau/nouveau_fbcon.c | 23 | ||||
-rw-r--r-- | drm/nouveau/nvkm/subdev/i2c/base.c | 2 |
9 files changed, 32 insertions, 23 deletions
diff --git a/drm/nouveau/dispnv04/crtc.c b/drm/nouveau/dispnv04/crtc.c index 542bb266a..3d96b49fe 100644 --- a/drm/nouveau/dispnv04/crtc.c +++ b/drm/nouveau/dispnv04/crtc.c @@ -703,7 +703,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc) struct drm_device *dev = crtc->dev; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_crtc_helper_funcs *funcs = crtc->helper_private; + const struct drm_crtc_helper_funcs *funcs = crtc->helper_private; if (nv_two_heads(dev)) NVSetOwner(dev, nv_crtc->index); @@ -724,7 +724,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc) static void nv_crtc_commit(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; - struct drm_crtc_helper_funcs *funcs = crtc->helper_private; + const struct drm_crtc_helper_funcs *funcs = crtc->helper_private; struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); nouveau_hw_load_state(dev, nv_crtc->index, &nv04_display(dev)->mode_reg); diff --git a/drm/nouveau/dispnv04/dac.c b/drm/nouveau/dispnv04/dac.c index d7b495a5f..af7249ca0 100644 --- a/drm/nouveau/dispnv04/dac.c +++ b/drm/nouveau/dispnv04/dac.c @@ -358,7 +358,7 @@ static bool nv04_dac_mode_fixup(struct drm_encoder *encoder, static void nv04_dac_prepare(struct drm_encoder *encoder) { - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; struct drm_device *dev = encoder->dev; int head = nouveau_crtc(encoder->crtc)->index; @@ -409,7 +409,7 @@ static void nv04_dac_commit(struct drm_encoder *encoder) struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_drm *drm = nouveau_drm(encoder->dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; helper->dpms(encoder, DRM_MODE_DPMS_ON); diff --git a/drm/nouveau/dispnv04/dfp.c b/drm/nouveau/dispnv04/dfp.c index f6ca343fd..7cfb0cbc9 100644 --- a/drm/nouveau/dispnv04/dfp.c +++ b/drm/nouveau/dispnv04/dfp.c @@ -244,7 +244,7 @@ static void nv04_dfp_prepare_sel_clk(struct drm_device *dev, static void nv04_dfp_prepare(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; struct drm_device *dev = encoder->dev; int head = nouveau_crtc(encoder->crtc)->index; struct nv04_crtc_reg *crtcstate = nv04_display(dev)->mode_reg.crtc_reg; @@ -445,7 +445,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) { struct drm_device *dev = encoder->dev; struct nouveau_drm *drm = nouveau_drm(dev); - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct dcb_output *dcbe = nv_encoder->dcb; diff --git a/drm/nouveau/dispnv04/disp.c b/drm/nouveau/dispnv04/disp.c index f96237ef2..4131be550 100644 --- a/drm/nouveau/dispnv04/disp.c +++ b/drm/nouveau/dispnv04/disp.c @@ -109,7 +109,7 @@ nv04_display_create(struct drm_device *dev) crtc->funcs->save(crtc); list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { - struct drm_encoder_helper_funcs *func = encoder->helper_private; + const struct drm_encoder_helper_funcs *func = encoder->helper_private; func->save(encoder); } @@ -138,7 +138,7 @@ nv04_display_destroy(struct drm_device *dev) /* Restore state */ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { - struct drm_encoder_helper_funcs *func = encoder->helper_private; + const struct drm_encoder_helper_funcs *func = encoder->helper_private; func->restore(encoder); } @@ -169,7 +169,7 @@ nv04_display_init(struct drm_device *dev) * on suspend too. */ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { - struct drm_encoder_helper_funcs *func = encoder->helper_private; + const struct drm_encoder_helper_funcs *func = encoder->helper_private; func->restore(encoder); } diff --git a/drm/nouveau/dispnv04/tvnv04.c b/drm/nouveau/dispnv04/tvnv04.c index d9664b37d..70e95cf6f 100644 --- a/drm/nouveau/dispnv04/tvnv04.c +++ b/drm/nouveau/dispnv04/tvnv04.c @@ -122,7 +122,7 @@ static void nv04_tv_prepare(struct drm_encoder *encoder) { struct drm_device *dev = encoder->dev; int head = nouveau_crtc(encoder->crtc)->index; - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; helper->dpms(encoder, DRM_MODE_DPMS_OFF); @@ -164,7 +164,7 @@ static void nv04_tv_commit(struct drm_encoder *encoder) struct drm_device *dev = encoder->dev; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; helper->dpms(encoder, DRM_MODE_DPMS_ON); diff --git a/drm/nouveau/dispnv04/tvnv17.c b/drm/nouveau/dispnv04/tvnv17.c index 731d74efc..d9720dda8 100644 --- a/drm/nouveau/dispnv04/tvnv17.c +++ b/drm/nouveau/dispnv04/tvnv17.c @@ -405,7 +405,7 @@ static void nv17_tv_prepare(struct drm_encoder *encoder) { struct drm_device *dev = encoder->dev; struct nouveau_drm *drm = nouveau_drm(dev); - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); int head = nouveau_crtc(encoder->crtc)->index; uint8_t *cr_lcd = &nv04_display(dev)->mode_reg.crtc_reg[head].CRTC[ @@ -583,7 +583,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder) struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_encoder_helper_funcs *helper = encoder->helper_private; + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; if (get_tv_norm(encoder)->kind == TV_ENC_MODE) { nv17_tv_update_rescaler(encoder); diff --git a/drm/nouveau/nouveau_connector.c b/drm/nouveau/nouveau_connector.c index db7095ae4..3162040bc 100644 --- a/drm/nouveau/nouveau_connector.c +++ b/drm/nouveau/nouveau_connector.c @@ -309,7 +309,7 @@ detect_analog: nv_encoder = find_encoder(connector, DCB_OUTPUT_TV); if (nv_encoder && force) { struct drm_encoder *encoder = to_drm_encoder(nv_encoder); - struct drm_encoder_helper_funcs *helper = + const struct drm_encoder_helper_funcs *helper = encoder->helper_private; if (helper->detect(encoder, connector) == @@ -592,7 +592,7 @@ nouveau_connector_set_property(struct drm_connector *connector, static struct drm_display_mode * nouveau_connector_native_mode(struct drm_connector *connector) { - struct drm_connector_helper_funcs *helper = connector->helper_private; + const struct drm_connector_helper_funcs *helper = connector->helper_private; struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct drm_device *dev = connector->dev; diff --git a/drm/nouveau/nouveau_fbcon.c b/drm/nouveau/nouveau_fbcon.c index d6e6958bc..6751553ab 100644 --- a/drm/nouveau/nouveau_fbcon.c +++ b/drm/nouveau/nouveau_fbcon.c @@ -418,7 +418,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, nouveau_fbcon_zfill(dev, fbcon); /* To allow resizeing without swapping buffers */ - NV_INFO(drm, "allocated %dx%d fb: 0x%lx, bo %p\n", + NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n", nouveau_fb->base.width, nouveau_fb->base.height, nvbo->bo.offset, nvbo); @@ -526,12 +526,12 @@ nouveau_fbcon_init(struct drm_device *dev) ret = drm_fb_helper_init(dev, &fbcon->helper, dev->mode_config.num_crtc, 4); - if (ret) { - kfree(fbcon); - return ret; - } + if (ret) + goto free; - drm_fb_helper_single_add_all_connectors(&fbcon->helper); + ret = drm_fb_helper_single_add_all_connectors(&fbcon->helper); + if (ret) + goto fini; if (drm->device.info.ram_size <= 32 * 1024 * 1024) preferred_bpp = 8; @@ -544,8 +544,17 @@ nouveau_fbcon_init(struct drm_device *dev) /* disable all the possible outputs/crtcs before entering KMS mode */ drm_helper_disable_unused_functions(dev); - drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp); + ret = drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp); + if (ret) + goto fini; + return 0; + +fini: + drm_fb_helper_fini(&fbcon->helper); +free: + kfree(fbcon); + return ret; } void diff --git a/drm/nouveau/nvkm/subdev/i2c/base.c b/drm/nouveau/nvkm/subdev/i2c/base.c index 8746cd519..9200f122c 100644 --- a/drm/nouveau/nvkm/subdev/i2c/base.c +++ b/drm/nouveau/nvkm/subdev/i2c/base.c @@ -281,7 +281,7 @@ static int nvkm_i2c_identify(struct nvkm_i2c *i2c, int index, const char *what, struct nvkm_i2c_board_info *info, bool (*match)(struct nvkm_i2c_port *, - struct i2c_board_info *, void *), void *data) + struct i2c_board_info *, void *), void *data) { struct nvkm_i2c_port *port = nvkm_i2c_find(i2c, index); int i; |