Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create()

Drivers shouldn't clobber the passed in addfb ioctl parameters.
i915 was doing just that. To prevent it from happening again,
pass the struct around as const, starting all the way from
internal_framebuffer_create().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Ville Syrjälä and committed by
Daniel Vetter
1eb83451 cc344980

+74 -74
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 481 481 int 482 482 amdgpu_framebuffer_init(struct drm_device *dev, 483 483 struct amdgpu_framebuffer *rfb, 484 - struct drm_mode_fb_cmd2 *mode_cmd, 484 + const struct drm_mode_fb_cmd2 *mode_cmd, 485 485 struct drm_gem_object *obj) 486 486 { 487 487 int ret; ··· 498 498 static struct drm_framebuffer * 499 499 amdgpu_user_framebuffer_create(struct drm_device *dev, 500 500 struct drm_file *file_priv, 501 - struct drm_mode_fb_cmd2 *mode_cmd) 501 + const struct drm_mode_fb_cmd2 *mode_cmd) 502 502 { 503 503 struct drm_gem_object *obj; 504 504 struct amdgpu_framebuffer *amdgpu_fb;
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
··· 551 551 552 552 int amdgpu_framebuffer_init(struct drm_device *dev, 553 553 struct amdgpu_framebuffer *rfb, 554 - struct drm_mode_fb_cmd2 *mode_cmd, 554 + const struct drm_mode_fb_cmd2 *mode_cmd, 555 555 struct drm_gem_object *obj); 556 556 557 557 int amdgpufb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
+2 -2
drivers/gpu/drm/armada/armada_fb.c
··· 35 35 }; 36 36 37 37 struct armada_framebuffer *armada_framebuffer_create(struct drm_device *dev, 38 - struct drm_mode_fb_cmd2 *mode, struct armada_gem_object *obj) 38 + const struct drm_mode_fb_cmd2 *mode, struct armada_gem_object *obj) 39 39 { 40 40 struct armada_framebuffer *dfb; 41 41 uint8_t format, config; ··· 101 101 } 102 102 103 103 static struct drm_framebuffer *armada_fb_create(struct drm_device *dev, 104 - struct drm_file *dfile, struct drm_mode_fb_cmd2 *mode) 104 + struct drm_file *dfile, const struct drm_mode_fb_cmd2 *mode) 105 105 { 106 106 struct armada_gem_object *obj; 107 107 struct armada_framebuffer *dfb;
+1 -1
drivers/gpu/drm/armada/armada_fb.h
··· 19 19 #define drm_fb_obj(fb) drm_fb_to_armada_fb(fb)->obj 20 20 21 21 struct armada_framebuffer *armada_framebuffer_create(struct drm_device *, 22 - struct drm_mode_fb_cmd2 *, struct armada_gem_object *); 22 + const struct drm_mode_fb_cmd2 *, struct armada_gem_object *); 23 23 24 24 #endif
+1 -1
drivers/gpu/drm/ast/ast_drv.h
··· 308 308 309 309 int ast_framebuffer_init(struct drm_device *dev, 310 310 struct ast_framebuffer *ast_fb, 311 - struct drm_mode_fb_cmd2 *mode_cmd, 311 + const struct drm_mode_fb_cmd2 *mode_cmd, 312 312 struct drm_gem_object *obj); 313 313 314 314 int ast_fbdev_init(struct drm_device *dev);
+1 -1
drivers/gpu/drm/ast/ast_fb.c
··· 163 163 }; 164 164 165 165 static int astfb_create_object(struct ast_fbdev *afbdev, 166 - struct drm_mode_fb_cmd2 *mode_cmd, 166 + const struct drm_mode_fb_cmd2 *mode_cmd, 167 167 struct drm_gem_object **gobj_p) 168 168 { 169 169 struct drm_device *dev = afbdev->helper.dev;
+2 -2
drivers/gpu/drm/ast/ast_main.c
··· 309 309 310 310 int ast_framebuffer_init(struct drm_device *dev, 311 311 struct ast_framebuffer *ast_fb, 312 - struct drm_mode_fb_cmd2 *mode_cmd, 312 + const struct drm_mode_fb_cmd2 *mode_cmd, 313 313 struct drm_gem_object *obj) 314 314 { 315 315 int ret; ··· 327 327 static struct drm_framebuffer * 328 328 ast_user_framebuffer_create(struct drm_device *dev, 329 329 struct drm_file *filp, 330 - struct drm_mode_fb_cmd2 *mode_cmd) 330 + const struct drm_mode_fb_cmd2 *mode_cmd) 331 331 { 332 332 struct drm_gem_object *obj; 333 333 struct ast_framebuffer *ast_fb;
+1 -1
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
··· 402 402 } 403 403 404 404 static struct drm_framebuffer *atmel_hlcdc_fb_create(struct drm_device *dev, 405 - struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd) 405 + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd) 406 406 { 407 407 return drm_fb_cma_create(dev, file_priv, mode_cmd); 408 408 }
+1 -1
drivers/gpu/drm/bochs/bochs.h
··· 149 149 150 150 int bochs_framebuffer_init(struct drm_device *dev, 151 151 struct bochs_framebuffer *gfb, 152 - struct drm_mode_fb_cmd2 *mode_cmd, 152 + const struct drm_mode_fb_cmd2 *mode_cmd, 153 153 struct drm_gem_object *obj); 154 154 int bochs_bo_pin(struct bochs_bo *bo, u32 pl_flag, u64 *gpu_addr); 155 155 int bochs_bo_unpin(struct bochs_bo *bo);
+1 -1
drivers/gpu/drm/bochs/bochs_fbdev.c
··· 34 34 }; 35 35 36 36 static int bochsfb_create_object(struct bochs_device *bochs, 37 - struct drm_mode_fb_cmd2 *mode_cmd, 37 + const struct drm_mode_fb_cmd2 *mode_cmd, 38 38 struct drm_gem_object **gobj_p) 39 39 { 40 40 struct drm_device *dev = bochs->dev;
+2 -2
drivers/gpu/drm/bochs/bochs_mm.c
··· 484 484 485 485 int bochs_framebuffer_init(struct drm_device *dev, 486 486 struct bochs_framebuffer *gfb, 487 - struct drm_mode_fb_cmd2 *mode_cmd, 487 + const struct drm_mode_fb_cmd2 *mode_cmd, 488 488 struct drm_gem_object *obj) 489 489 { 490 490 int ret; ··· 502 502 static struct drm_framebuffer * 503 503 bochs_user_framebuffer_create(struct drm_device *dev, 504 504 struct drm_file *filp, 505 - struct drm_mode_fb_cmd2 *mode_cmd) 505 + const struct drm_mode_fb_cmd2 *mode_cmd) 506 506 { 507 507 struct drm_gem_object *obj; 508 508 struct bochs_framebuffer *bochs_fb;
+1 -1
drivers/gpu/drm/cirrus/cirrus_drv.h
··· 206 206 207 207 int cirrus_framebuffer_init(struct drm_device *dev, 208 208 struct cirrus_framebuffer *gfb, 209 - struct drm_mode_fb_cmd2 *mode_cmd, 209 + const struct drm_mode_fb_cmd2 *mode_cmd, 210 210 struct drm_gem_object *obj); 211 211 212 212 bool cirrus_check_framebuffer(struct cirrus_device *cdev, int width, int height,
+1 -1
drivers/gpu/drm/cirrus/cirrus_fbdev.c
··· 135 135 }; 136 136 137 137 static int cirrusfb_create_object(struct cirrus_fbdev *afbdev, 138 - struct drm_mode_fb_cmd2 *mode_cmd, 138 + const struct drm_mode_fb_cmd2 *mode_cmd, 139 139 struct drm_gem_object **gobj_p) 140 140 { 141 141 struct drm_device *dev = afbdev->helper.dev;
+2 -2
drivers/gpu/drm/cirrus/cirrus_main.c
··· 29 29 30 30 int cirrus_framebuffer_init(struct drm_device *dev, 31 31 struct cirrus_framebuffer *gfb, 32 - struct drm_mode_fb_cmd2 *mode_cmd, 32 + const struct drm_mode_fb_cmd2 *mode_cmd, 33 33 struct drm_gem_object *obj) 34 34 { 35 35 int ret; ··· 47 47 static struct drm_framebuffer * 48 48 cirrus_user_framebuffer_create(struct drm_device *dev, 49 49 struct drm_file *filp, 50 - struct drm_mode_fb_cmd2 *mode_cmd) 50 + const struct drm_mode_fb_cmd2 *mode_cmd) 51 51 { 52 52 struct cirrus_device *cdev = dev->dev_private; 53 53 struct drm_gem_object *obj;
+2 -2
drivers/gpu/drm/drm_crtc.c
··· 45 45 46 46 static struct drm_framebuffer * 47 47 internal_framebuffer_create(struct drm_device *dev, 48 - struct drm_mode_fb_cmd2 *r, 48 + const struct drm_mode_fb_cmd2 *r, 49 49 struct drm_file *file_priv); 50 50 51 51 /* Avoid boilerplate. I'm tired of typing. */ ··· 3235 3235 3236 3236 static struct drm_framebuffer * 3237 3237 internal_framebuffer_create(struct drm_device *dev, 3238 - struct drm_mode_fb_cmd2 *r, 3238 + const struct drm_mode_fb_cmd2 *r, 3239 3239 struct drm_file *file_priv) 3240 3240 { 3241 3241 struct drm_mode_config *config = &dev->mode_config;
+1 -1
drivers/gpu/drm/drm_crtc_helper.c
··· 818 818 * metadata fields. 819 819 */ 820 820 void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, 821 - struct drm_mode_fb_cmd2 *mode_cmd) 821 + const struct drm_mode_fb_cmd2 *mode_cmd) 822 822 { 823 823 int i; 824 824
+2 -2
drivers/gpu/drm/drm_fb_cma_helper.c
··· 74 74 }; 75 75 76 76 static struct drm_fb_cma *drm_fb_cma_alloc(struct drm_device *dev, 77 - struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_cma_object **obj, 77 + const const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_cma_object **obj, 78 78 unsigned int num_planes) 79 79 { 80 80 struct drm_fb_cma *fb_cma; ··· 107 107 * checked before calling this function. 108 108 */ 109 109 struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev, 110 - struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd) 110 + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd) 111 111 { 112 112 struct drm_fb_cma *fb_cma; 113 113 struct drm_gem_cma_object *objs[4];
+2 -2
drivers/gpu/drm/exynos/exynos_drm_fb.c
··· 117 117 118 118 struct drm_framebuffer * 119 119 exynos_drm_framebuffer_init(struct drm_device *dev, 120 - struct drm_mode_fb_cmd2 *mode_cmd, 120 + const struct drm_mode_fb_cmd2 *mode_cmd, 121 121 struct exynos_drm_gem **exynos_gem, 122 122 int count) 123 123 { ··· 154 154 155 155 static struct drm_framebuffer * 156 156 exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, 157 - struct drm_mode_fb_cmd2 *mode_cmd) 157 + const struct drm_mode_fb_cmd2 *mode_cmd) 158 158 { 159 159 struct exynos_drm_gem *exynos_gem[MAX_FB_BUFFER]; 160 160 struct drm_gem_object *obj;
+1 -1
drivers/gpu/drm/exynos/exynos_drm_fb.h
··· 18 18 19 19 struct drm_framebuffer * 20 20 exynos_drm_framebuffer_init(struct drm_device *dev, 21 - struct drm_mode_fb_cmd2 *mode_cmd, 21 + const struct drm_mode_fb_cmd2 *mode_cmd, 22 22 struct exynos_drm_gem **exynos_gem, 23 23 int count); 24 24
+3 -3
drivers/gpu/drm/gma500/framebuffer.c
··· 241 241 */ 242 242 static int psb_framebuffer_init(struct drm_device *dev, 243 243 struct psb_framebuffer *fb, 244 - struct drm_mode_fb_cmd2 *mode_cmd, 244 + const struct drm_mode_fb_cmd2 *mode_cmd, 245 245 struct gtt_range *gt) 246 246 { 247 247 u32 bpp, depth; ··· 284 284 285 285 static struct drm_framebuffer *psb_framebuffer_create 286 286 (struct drm_device *dev, 287 - struct drm_mode_fb_cmd2 *mode_cmd, 287 + const struct drm_mode_fb_cmd2 *mode_cmd, 288 288 struct gtt_range *gt) 289 289 { 290 290 struct psb_framebuffer *fb; ··· 488 488 */ 489 489 static struct drm_framebuffer *psb_user_framebuffer_create 490 490 (struct drm_device *dev, struct drm_file *filp, 491 - struct drm_mode_fb_cmd2 *cmd) 491 + const struct drm_mode_fb_cmd2 *cmd) 492 492 { 493 493 struct gtt_range *r; 494 494 struct drm_gem_object *obj;
+1 -1
drivers/gpu/drm/i915/intel_display.c
··· 14377 14377 static struct drm_framebuffer * 14378 14378 intel_user_framebuffer_create(struct drm_device *dev, 14379 14379 struct drm_file *filp, 14380 - struct drm_mode_fb_cmd2 *user_mode_cmd) 14380 + const struct drm_mode_fb_cmd2 *user_mode_cmd) 14381 14381 { 14382 14382 struct drm_i915_gem_object *obj; 14383 14383 struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
+1 -1
drivers/gpu/drm/mgag200/mgag200_drv.h
··· 252 252 /* mgag200_main.c */ 253 253 int mgag200_framebuffer_init(struct drm_device *dev, 254 254 struct mga_framebuffer *mfb, 255 - struct drm_mode_fb_cmd2 *mode_cmd, 255 + const struct drm_mode_fb_cmd2 *mode_cmd, 256 256 struct drm_gem_object *obj); 257 257 258 258
+1 -1
drivers/gpu/drm/mgag200/mgag200_fb.c
··· 138 138 }; 139 139 140 140 static int mgag200fb_create_object(struct mga_fbdev *afbdev, 141 - struct drm_mode_fb_cmd2 *mode_cmd, 141 + const struct drm_mode_fb_cmd2 *mode_cmd, 142 142 struct drm_gem_object **gobj_p) 143 143 { 144 144 struct drm_device *dev = afbdev->helper.dev;
+2 -2
drivers/gpu/drm/mgag200/mgag200_main.c
··· 29 29 30 30 int mgag200_framebuffer_init(struct drm_device *dev, 31 31 struct mga_framebuffer *gfb, 32 - struct drm_mode_fb_cmd2 *mode_cmd, 32 + const struct drm_mode_fb_cmd2 *mode_cmd, 33 33 struct drm_gem_object *obj) 34 34 { 35 35 int ret; ··· 47 47 static struct drm_framebuffer * 48 48 mgag200_user_framebuffer_create(struct drm_device *dev, 49 49 struct drm_file *filp, 50 - struct drm_mode_fb_cmd2 *mode_cmd) 50 + const struct drm_mode_fb_cmd2 *mode_cmd) 51 51 { 52 52 struct drm_gem_object *obj; 53 53 struct mga_framebuffer *mga_fb;
+2 -2
drivers/gpu/drm/msm/msm_drv.h
··· 240 240 struct drm_gem_object *msm_framebuffer_bo(struct drm_framebuffer *fb, int plane); 241 241 const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb); 242 242 struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, 243 - struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); 243 + const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); 244 244 struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev, 245 - struct drm_file *file, struct drm_mode_fb_cmd2 *mode_cmd); 245 + struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd); 246 246 247 247 struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev); 248 248
+2 -2
drivers/gpu/drm/msm/msm_fb.c
··· 138 138 } 139 139 140 140 struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev, 141 - struct drm_file *file, struct drm_mode_fb_cmd2 *mode_cmd) 141 + struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd) 142 142 { 143 143 struct drm_gem_object *bos[4] = {0}; 144 144 struct drm_framebuffer *fb; ··· 168 168 } 169 169 170 170 struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, 171 - struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) 171 + const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) 172 172 { 173 173 struct msm_drm_private *priv = dev->dev_private; 174 174 struct msm_kms *kms = priv->kms;
+2 -2
drivers/gpu/drm/nouveau/nouveau_display.c
··· 246 246 int 247 247 nouveau_framebuffer_init(struct drm_device *dev, 248 248 struct nouveau_framebuffer *nv_fb, 249 - struct drm_mode_fb_cmd2 *mode_cmd, 249 + const struct drm_mode_fb_cmd2 *mode_cmd, 250 250 struct nouveau_bo *nvbo) 251 251 { 252 252 struct nouveau_display *disp = nouveau_display(dev); ··· 272 272 static struct drm_framebuffer * 273 273 nouveau_user_framebuffer_create(struct drm_device *dev, 274 274 struct drm_file *file_priv, 275 - struct drm_mode_fb_cmd2 *mode_cmd) 275 + const struct drm_mode_fb_cmd2 *mode_cmd) 276 276 { 277 277 struct nouveau_framebuffer *nouveau_fb; 278 278 struct drm_gem_object *gem;
+1 -1
drivers/gpu/drm/nouveau/nouveau_display.h
··· 23 23 } 24 24 25 25 int nouveau_framebuffer_init(struct drm_device *, struct nouveau_framebuffer *, 26 - struct drm_mode_fb_cmd2 *, struct nouveau_bo *); 26 + const struct drm_mode_fb_cmd2 *, struct nouveau_bo *); 27 27 28 28 struct nouveau_page_flip_state { 29 29 struct list_head head;
+3 -3
drivers/gpu/drm/omapdrm/omap_drv.h
··· 172 172 uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats, 173 173 uint32_t max_formats, enum omap_color_mode supported_modes); 174 174 struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, 175 - struct drm_file *file, struct drm_mode_fb_cmd2 *mode_cmd); 175 + struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd); 176 176 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, 177 - struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); 177 + const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); 178 178 struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p); 179 179 int omap_framebuffer_pin(struct drm_framebuffer *fb); 180 180 void omap_framebuffer_unpin(struct drm_framebuffer *fb); ··· 248 248 249 249 static inline int objects_lookup(struct drm_device *dev, 250 250 struct drm_file *filp, uint32_t pixel_format, 251 - struct drm_gem_object **bos, uint32_t *handles) 251 + struct drm_gem_object **bos, const uint32_t *handles) 252 252 { 253 253 int i, n = drm_format_num_planes(pixel_format); 254 254
+2 -2
drivers/gpu/drm/omapdrm/omap_fb.c
··· 364 364 #endif 365 365 366 366 struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, 367 - struct drm_file *file, struct drm_mode_fb_cmd2 *mode_cmd) 367 + struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd) 368 368 { 369 369 struct drm_gem_object *bos[4]; 370 370 struct drm_framebuffer *fb; ··· 386 386 } 387 387 388 388 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, 389 - struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) 389 + const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) 390 390 { 391 391 struct omap_framebuffer *omap_fb = NULL; 392 392 struct drm_framebuffer *fb = NULL;
+2 -2
drivers/gpu/drm/qxl/qxl_display.c
··· 521 521 int 522 522 qxl_framebuffer_init(struct drm_device *dev, 523 523 struct qxl_framebuffer *qfb, 524 - struct drm_mode_fb_cmd2 *mode_cmd, 524 + const struct drm_mode_fb_cmd2 *mode_cmd, 525 525 struct drm_gem_object *obj) 526 526 { 527 527 int ret; ··· 1003 1003 static struct drm_framebuffer * 1004 1004 qxl_user_framebuffer_create(struct drm_device *dev, 1005 1005 struct drm_file *file_priv, 1006 - struct drm_mode_fb_cmd2 *mode_cmd) 1006 + const struct drm_mode_fb_cmd2 *mode_cmd) 1007 1007 { 1008 1008 struct drm_gem_object *obj; 1009 1009 struct qxl_framebuffer *qxl_fb;
+1 -1
drivers/gpu/drm/qxl/qxl_drv.h
··· 390 390 int 391 391 qxl_framebuffer_init(struct drm_device *dev, 392 392 struct qxl_framebuffer *rfb, 393 - struct drm_mode_fb_cmd2 *mode_cmd, 393 + const struct drm_mode_fb_cmd2 *mode_cmd, 394 394 struct drm_gem_object *obj); 395 395 void qxl_display_read_client_monitors_config(struct qxl_device *qdev); 396 396 void qxl_send_monitors_config(struct qxl_device *qdev);
+1 -1
drivers/gpu/drm/qxl/qxl_fb.c
··· 282 282 } 283 283 284 284 static int qxlfb_create_pinned_object(struct qxl_fbdev *qfbdev, 285 - struct drm_mode_fb_cmd2 *mode_cmd, 285 + const struct drm_mode_fb_cmd2 *mode_cmd, 286 286 struct drm_gem_object **gobj_p) 287 287 { 288 288 struct qxl_device *qdev = qfbdev->qdev;
+2 -2
drivers/gpu/drm/radeon/radeon_display.c
··· 1292 1292 int 1293 1293 radeon_framebuffer_init(struct drm_device *dev, 1294 1294 struct radeon_framebuffer *rfb, 1295 - struct drm_mode_fb_cmd2 *mode_cmd, 1295 + const struct drm_mode_fb_cmd2 *mode_cmd, 1296 1296 struct drm_gem_object *obj) 1297 1297 { 1298 1298 int ret; ··· 1309 1309 static struct drm_framebuffer * 1310 1310 radeon_user_framebuffer_create(struct drm_device *dev, 1311 1311 struct drm_file *file_priv, 1312 - struct drm_mode_fb_cmd2 *mode_cmd) 1312 + const struct drm_mode_fb_cmd2 *mode_cmd) 1313 1313 { 1314 1314 struct drm_gem_object *obj; 1315 1315 struct radeon_framebuffer *radeon_fb;
+1 -1
drivers/gpu/drm/radeon/radeon_mode.h
··· 929 929 u16 *blue, int regno); 930 930 int radeon_framebuffer_init(struct drm_device *dev, 931 931 struct radeon_framebuffer *rfb, 932 - struct drm_mode_fb_cmd2 *mode_cmd, 932 + const struct drm_mode_fb_cmd2 *mode_cmd, 933 933 struct drm_gem_object *obj); 934 934 935 935 int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
+1 -1
drivers/gpu/drm/rcar-du/rcar_du_kms.c
··· 136 136 137 137 static struct drm_framebuffer * 138 138 rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv, 139 - struct drm_mode_fb_cmd2 *mode_cmd) 139 + const struct drm_mode_fb_cmd2 *mode_cmd) 140 140 { 141 141 struct rcar_du_device *rcdu = dev->dev_private; 142 142 const struct rcar_du_format_info *format;
+3 -3
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
··· 72 72 }; 73 73 74 74 static struct rockchip_drm_fb * 75 - rockchip_fb_alloc(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd, 75 + rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, 76 76 struct drm_gem_object **obj, unsigned int num_planes) 77 77 { 78 78 struct rockchip_drm_fb *rockchip_fb; ··· 102 102 103 103 static struct drm_framebuffer * 104 104 rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, 105 - struct drm_mode_fb_cmd2 *mode_cmd) 105 + const struct drm_mode_fb_cmd2 *mode_cmd) 106 106 { 107 107 struct rockchip_drm_fb *rockchip_fb; 108 108 struct drm_gem_object *objs[ROCKCHIP_MAX_FB_BUFFER]; ··· 173 173 174 174 struct drm_framebuffer * 175 175 rockchip_drm_framebuffer_init(struct drm_device *dev, 176 - struct drm_mode_fb_cmd2 *mode_cmd, 176 + const struct drm_mode_fb_cmd2 *mode_cmd, 177 177 struct drm_gem_object *obj) 178 178 { 179 179 struct rockchip_drm_fb *rockchip_fb;
+1 -1
drivers/gpu/drm/rockchip/rockchip_drm_fb.h
··· 17 17 18 18 struct drm_framebuffer * 19 19 rockchip_drm_framebuffer_init(struct drm_device *dev, 20 - struct drm_mode_fb_cmd2 *mode_cmd, 20 + const struct drm_mode_fb_cmd2 *mode_cmd, 21 21 struct drm_gem_object *obj); 22 22 void rockchip_drm_framebuffer_fini(struct drm_framebuffer *fb); 23 23
+1 -1
drivers/gpu/drm/shmobile/shmob_drm_kms.c
··· 104 104 105 105 static struct drm_framebuffer * 106 106 shmob_drm_fb_create(struct drm_device *dev, struct drm_file *file_priv, 107 - struct drm_mode_fb_cmd2 *mode_cmd) 107 + const struct drm_mode_fb_cmd2 *mode_cmd) 108 108 { 109 109 const struct shmob_drm_format_info *format; 110 110
+1 -1
drivers/gpu/drm/tegra/drm.h
··· 268 268 struct tegra_bo_tiling *tiling); 269 269 struct drm_framebuffer *tegra_fb_create(struct drm_device *drm, 270 270 struct drm_file *file, 271 - struct drm_mode_fb_cmd2 *cmd); 271 + const struct drm_mode_fb_cmd2 *cmd); 272 272 int tegra_drm_fb_prepare(struct drm_device *drm); 273 273 void tegra_drm_fb_free(struct drm_device *drm); 274 274 int tegra_drm_fb_init(struct drm_device *drm);
+2 -2
drivers/gpu/drm/tegra/fb.c
··· 92 92 }; 93 93 94 94 static struct tegra_fb *tegra_fb_alloc(struct drm_device *drm, 95 - struct drm_mode_fb_cmd2 *mode_cmd, 95 + const struct drm_mode_fb_cmd2 *mode_cmd, 96 96 struct tegra_bo **planes, 97 97 unsigned int num_planes) 98 98 { ··· 131 131 132 132 struct drm_framebuffer *tegra_fb_create(struct drm_device *drm, 133 133 struct drm_file *file, 134 - struct drm_mode_fb_cmd2 *cmd) 134 + const struct drm_mode_fb_cmd2 *cmd) 135 135 { 136 136 unsigned int hsub, vsub, i; 137 137 struct tegra_bo *planes[4];
+1 -1
drivers/gpu/drm/tilcdc/tilcdc_drv.c
··· 46 46 static struct of_device_id tilcdc_of_match[]; 47 47 48 48 static struct drm_framebuffer *tilcdc_fb_create(struct drm_device *dev, 49 - struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd) 49 + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd) 50 50 { 51 51 return drm_fb_cma_create(dev, file_priv, mode_cmd); 52 52 }
+1 -1
drivers/gpu/drm/udl/udl_drv.h
··· 108 108 struct drm_framebuffer * 109 109 udl_fb_user_fb_create(struct drm_device *dev, 110 110 struct drm_file *file, 111 - struct drm_mode_fb_cmd2 *mode_cmd); 111 + const struct drm_mode_fb_cmd2 *mode_cmd); 112 112 113 113 int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr, 114 114 const char *front, char **urb_buf_ptr,
+2 -2
drivers/gpu/drm/udl/udl_fb.c
··· 455 455 static int 456 456 udl_framebuffer_init(struct drm_device *dev, 457 457 struct udl_framebuffer *ufb, 458 - struct drm_mode_fb_cmd2 *mode_cmd, 458 + const struct drm_mode_fb_cmd2 *mode_cmd, 459 459 struct udl_gem_object *obj) 460 460 { 461 461 int ret; ··· 623 623 struct drm_framebuffer * 624 624 udl_fb_user_fb_create(struct drm_device *dev, 625 625 struct drm_file *file, 626 - struct drm_mode_fb_cmd2 *mode_cmd) 626 + const struct drm_mode_fb_cmd2 *mode_cmd) 627 627 { 628 628 struct drm_gem_object *obj; 629 629 struct udl_framebuffer *ufb;
+2 -2
drivers/gpu/drm/virtio/virtgpu_display.c
··· 215 215 int 216 216 virtio_gpu_framebuffer_init(struct drm_device *dev, 217 217 struct virtio_gpu_framebuffer *vgfb, 218 - struct drm_mode_fb_cmd2 *mode_cmd, 218 + const struct drm_mode_fb_cmd2 *mode_cmd, 219 219 struct drm_gem_object *obj) 220 220 { 221 221 int ret; ··· 465 465 static struct drm_framebuffer * 466 466 virtio_gpu_user_framebuffer_create(struct drm_device *dev, 467 467 struct drm_file *file_priv, 468 - struct drm_mode_fb_cmd2 *mode_cmd) 468 + const struct drm_mode_fb_cmd2 *mode_cmd) 469 469 { 470 470 struct drm_gem_object *obj = NULL; 471 471 struct virtio_gpu_framebuffer *virtio_gpu_fb;
+1 -1
drivers/gpu/drm/virtio/virtgpu_drv.h
··· 328 328 /* virtio_gpu_display.c */ 329 329 int virtio_gpu_framebuffer_init(struct drm_device *dev, 330 330 struct virtio_gpu_framebuffer *vgfb, 331 - struct drm_mode_fb_cmd2 *mode_cmd, 331 + const struct drm_mode_fb_cmd2 *mode_cmd, 332 332 struct drm_gem_object *obj); 333 333 int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev); 334 334 void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev);
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 930 930 931 931 static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, 932 932 struct drm_file *file_priv, 933 - struct drm_mode_fb_cmd2 *mode_cmd2) 933 + const struct drm_mode_fb_cmd2 *mode_cmd2) 934 934 { 935 935 struct vmw_private *dev_priv = vmw_priv(dev); 936 936 struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile;
+1 -1
include/drm/drm_crtc.h
··· 996 996 struct drm_mode_config_funcs { 997 997 struct drm_framebuffer *(*fb_create)(struct drm_device *dev, 998 998 struct drm_file *file_priv, 999 - struct drm_mode_fb_cmd2 *mode_cmd); 999 + const struct drm_mode_fb_cmd2 *mode_cmd); 1000 1000 void (*output_poll_changed)(struct drm_device *dev); 1001 1001 1002 1002 int (*atomic_check)(struct drm_device *dev,
+1 -1
include/drm/drm_crtc_helper.h
··· 197 197 extern void drm_helper_move_panel_connectors_to_head(struct drm_device *); 198 198 199 199 extern void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, 200 - struct drm_mode_fb_cmd2 *mode_cmd); 200 + const struct drm_mode_fb_cmd2 *mode_cmd); 201 201 202 202 static inline void drm_crtc_helper_add(struct drm_crtc *crtc, 203 203 const struct drm_crtc_helper_funcs *funcs)
+1 -1
include/drm/drm_fb_cma_helper.h
··· 18 18 void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma); 19 19 20 20 struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev, 21 - struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd); 21 + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd); 22 22 23 23 struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, 24 24 unsigned int plane);