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

drm: Pass struct drm_file * to __drm_mode_object_find [v2]

This will allow __drm_mode_object_file to be extended to perform
access control checks based on the file in use.

v2: Also fix up vboxvideo driver in staging

[airlied: merging early as this is an API change]

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Keith Packard and committed by
Dave Airlie
418da172 bb7a9c8d

+85 -73
+8 -8
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
··· 231 231 if (connector->encoder_ids[i] == 0) 232 232 break; 233 233 234 - encoder = drm_encoder_find(connector->dev, 234 + encoder = drm_encoder_find(connector->dev, NULL, 235 235 connector->encoder_ids[i]); 236 236 if (!encoder) 237 237 continue; ··· 256 256 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { 257 257 if (connector->encoder_ids[i] == 0) 258 258 break; 259 - encoder = drm_encoder_find(connector->dev, 259 + encoder = drm_encoder_find(connector->dev, NULL, 260 260 connector->encoder_ids[i]); 261 261 if (!encoder) 262 262 continue; ··· 372 372 373 373 /* pick the encoder ids */ 374 374 if (enc_id) 375 - return drm_encoder_find(connector->dev, enc_id); 375 + return drm_encoder_find(connector->dev, NULL, enc_id); 376 376 return NULL; 377 377 } 378 378 ··· 1077 1077 if (connector->encoder_ids[i] == 0) 1078 1078 break; 1079 1079 1080 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 1080 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 1081 1081 if (!encoder) 1082 1082 continue; 1083 1083 ··· 1134 1134 if (connector->encoder_ids[i] == 0) 1135 1135 break; 1136 1136 1137 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 1137 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 1138 1138 if (!encoder) 1139 1139 continue; 1140 1140 ··· 1153 1153 /* then check use digitial */ 1154 1154 /* pick the first one */ 1155 1155 if (enc_id) 1156 - return drm_encoder_find(connector->dev, enc_id); 1156 + return drm_encoder_find(connector->dev, NULL, enc_id); 1157 1157 return NULL; 1158 1158 } 1159 1159 ··· 1294 1294 if (connector->encoder_ids[i] == 0) 1295 1295 break; 1296 1296 1297 - encoder = drm_encoder_find(connector->dev, 1297 + encoder = drm_encoder_find(connector->dev, NULL, 1298 1298 connector->encoder_ids[i]); 1299 1299 if (!encoder) 1300 1300 continue; ··· 1323 1323 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { 1324 1324 if (connector->encoder_ids[i] == 0) 1325 1325 break; 1326 - encoder = drm_encoder_find(connector->dev, 1326 + encoder = drm_encoder_find(connector->dev, NULL, 1327 1327 connector->encoder_ids[i]); 1328 1328 if (!encoder) 1329 1329 continue;
+2 -2
drivers/gpu/drm/amd/amdgpu/dce_virtual.c
··· 288 288 if (connector->encoder_ids[i] == 0) 289 289 break; 290 290 291 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 291 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 292 292 if (!encoder) 293 293 continue; 294 294 ··· 298 298 299 299 /* pick the first one */ 300 300 if (enc_id) 301 - return drm_encoder_find(connector->dev, enc_id); 301 + return drm_encoder_find(connector->dev, NULL, enc_id); 302 302 return NULL; 303 303 } 304 304
+1 -1
drivers/gpu/drm/ast/ast_mode.c
··· 713 713 int enc_id = connector->encoder_ids[0]; 714 714 /* pick the encoder ids */ 715 715 if (enc_id) 716 - return drm_encoder_find(connector->dev, enc_id); 716 + return drm_encoder_find(connector->dev, NULL, enc_id); 717 717 return NULL; 718 718 } 719 719
+1 -1
drivers/gpu/drm/bochs/bochs_kms.c
··· 213 213 int enc_id = connector->encoder_ids[0]; 214 214 /* pick the encoder ids */ 215 215 if (enc_id) 216 - return drm_encoder_find(connector->dev, enc_id); 216 + return drm_encoder_find(connector->dev, NULL, enc_id); 217 217 return NULL; 218 218 } 219 219
+1 -1
drivers/gpu/drm/cirrus/cirrus_mode.c
··· 457 457 int enc_id = connector->encoder_ids[0]; 458 458 /* pick the encoder ids */ 459 459 if (enc_id) 460 - return drm_encoder_find(connector->dev, enc_id); 460 + return drm_encoder_find(connector->dev, NULL, enc_id); 461 461 return NULL; 462 462 } 463 463
+4 -4
drivers/gpu/drm/drm_atomic.c
··· 718 718 struct drm_mode_config *config = &dev->mode_config; 719 719 720 720 if (property == config->prop_fb_id) { 721 - struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, val); 721 + struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val); 722 722 drm_atomic_set_fb_for_plane(state, fb); 723 723 if (fb) 724 724 drm_framebuffer_put(fb); ··· 734 734 return -EINVAL; 735 735 736 736 } else if (property == config->prop_crtc_id) { 737 - struct drm_crtc *crtc = drm_crtc_find(dev, val); 737 + struct drm_crtc *crtc = drm_crtc_find(dev, NULL, val); 738 738 return drm_atomic_set_crtc_for_plane(state, crtc); 739 739 } else if (property == config->prop_crtc_x) { 740 740 state->crtc_x = U642I64(val); ··· 1149 1149 struct drm_mode_config *config = &dev->mode_config; 1150 1150 1151 1151 if (property == config->prop_crtc_id) { 1152 - struct drm_crtc *crtc = drm_crtc_find(dev, val); 1152 + struct drm_crtc *crtc = drm_crtc_find(dev, NULL, val); 1153 1153 return drm_atomic_set_crtc_for_connector(state, crtc); 1154 1154 } else if (property == config->dpms_property) { 1155 1155 /* setting DPMS property requires special handling, which ··· 2259 2259 goto out; 2260 2260 } 2261 2261 2262 - obj = drm_mode_object_find(dev, obj_id, DRM_MODE_OBJECT_ANY); 2262 + obj = drm_mode_object_find(dev, file_priv, obj_id, DRM_MODE_OBJECT_ANY); 2263 2263 if (!obj) { 2264 2264 ret = -ENOENT; 2265 2265 goto out;
+1 -1
drivers/gpu/drm/drm_atomic_helper.c
··· 3206 3206 drm_atomic_helper_best_encoder(struct drm_connector *connector) 3207 3207 { 3208 3208 WARN_ON(connector->encoder_ids[1]); 3209 - return drm_encoder_find(connector->dev, connector->encoder_ids[0]); 3209 + return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]); 3210 3210 } 3211 3211 EXPORT_SYMBOL(drm_atomic_helper_best_encoder); 3212 3212
+2 -2
drivers/gpu/drm/drm_color_mgmt.c
··· 230 230 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 231 231 return -EINVAL; 232 232 233 - crtc = drm_crtc_find(dev, crtc_lut->crtc_id); 233 + crtc = drm_crtc_find(dev, file_priv, crtc_lut->crtc_id); 234 234 if (!crtc) 235 235 return -ENOENT; 236 236 ··· 308 308 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 309 309 return -EINVAL; 310 310 311 - crtc = drm_crtc_find(dev, crtc_lut->crtc_id); 311 + crtc = drm_crtc_find(dev, file_priv, crtc_lut->crtc_id); 312 312 if (!crtc) 313 313 return -ENOENT; 314 314
+1 -1
drivers/gpu/drm/drm_connector.c
··· 1310 1310 1311 1311 memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo)); 1312 1312 1313 - connector = drm_connector_lookup(dev, out_resp->connector_id); 1313 + connector = drm_connector_lookup(dev, file_priv, out_resp->connector_id); 1314 1314 if (!connector) 1315 1315 return -ENOENT; 1316 1316
+4 -4
drivers/gpu/drm/drm_crtc.c
··· 402 402 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 403 403 return -EINVAL; 404 404 405 - crtc = drm_crtc_find(dev, crtc_resp->crtc_id); 405 + crtc = drm_crtc_find(dev, file_priv, crtc_resp->crtc_id); 406 406 if (!crtc) 407 407 return -ENOENT; 408 408 ··· 569 569 if (crtc_req->x & 0xffff0000 || crtc_req->y & 0xffff0000) 570 570 return -ERANGE; 571 571 572 - crtc = drm_crtc_find(dev, crtc_req->crtc_id); 572 + crtc = drm_crtc_find(dev, file_priv, crtc_req->crtc_id); 573 573 if (!crtc) { 574 574 DRM_DEBUG_KMS("Unknown CRTC ID %d\n", crtc_req->crtc_id); 575 575 return -ENOENT; ··· 595 595 /* Make refcounting symmetric with the lookup path. */ 596 596 drm_framebuffer_get(fb); 597 597 } else { 598 - fb = drm_framebuffer_lookup(dev, crtc_req->fb_id); 598 + fb = drm_framebuffer_lookup(dev, file_priv, crtc_req->fb_id); 599 599 if (!fb) { 600 600 DRM_DEBUG_KMS("Unknown FB ID%d\n", 601 601 crtc_req->fb_id); ··· 680 680 goto out; 681 681 } 682 682 683 - connector = drm_connector_lookup(dev, out_id); 683 + connector = drm_connector_lookup(dev, file_priv, out_id); 684 684 if (!connector) { 685 685 DRM_DEBUG_KMS("Connector id %d unknown\n", 686 686 out_id);
+1
drivers/gpu/drm/drm_crtc_internal.h
··· 106 106 void drm_mode_object_register(struct drm_device *dev, 107 107 struct drm_mode_object *obj); 108 108 struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev, 109 + struct drm_file *file_priv, 109 110 uint32_t id, uint32_t type); 110 111 void drm_mode_object_unregister(struct drm_device *dev, 111 112 struct drm_mode_object *object);
+1 -1
drivers/gpu/drm/drm_encoder.c
··· 220 220 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 221 221 return -EINVAL; 222 222 223 - encoder = drm_encoder_find(dev, enc_resp->encoder_id); 223 + encoder = drm_encoder_find(dev, file_priv, enc_resp->encoder_id); 224 224 if (!encoder) 225 225 return -ENOENT; 226 226
+5 -4
drivers/gpu/drm/drm_framebuffer.c
··· 381 381 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 382 382 return -EINVAL; 383 383 384 - fb = drm_framebuffer_lookup(dev, *id); 384 + fb = drm_framebuffer_lookup(dev, file_priv, *id); 385 385 if (!fb) 386 386 return -ENOENT; 387 387 ··· 450 450 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 451 451 return -EINVAL; 452 452 453 - fb = drm_framebuffer_lookup(dev, r->fb_id); 453 + fb = drm_framebuffer_lookup(dev, file_priv, r->fb_id); 454 454 if (!fb) 455 455 return -ENOENT; 456 456 ··· 515 515 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 516 516 return -EINVAL; 517 517 518 - fb = drm_framebuffer_lookup(dev, r->fb_id); 518 + fb = drm_framebuffer_lookup(dev, file_priv, r->fb_id); 519 519 if (!fb) 520 520 return -ENOENT; 521 521 ··· 688 688 * again, using drm_framebuffer_put(). 689 689 */ 690 690 struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev, 691 + struct drm_file *file_priv, 691 692 uint32_t id) 692 693 { 693 694 struct drm_mode_object *obj; 694 695 struct drm_framebuffer *fb = NULL; 695 696 696 - obj = __drm_mode_object_find(dev, id, DRM_MODE_OBJECT_FB); 697 + obj = __drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_FB); 697 698 if (obj) 698 699 fb = obj_to_fb(obj); 699 700 return fb;
+6 -4
drivers/gpu/drm/drm_mode_object.c
··· 105 105 } 106 106 107 107 struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev, 108 + struct drm_file *file_priv, 108 109 uint32_t id, uint32_t type) 109 110 { 110 111 struct drm_mode_object *obj = NULL; ··· 128 127 129 128 /** 130 129 * drm_mode_object_find - look up a drm object with static lifetime 131 - * @dev: drm device 130 + * @file_priv: drm file 132 131 * @id: id of the mode object 133 132 * @type: type of the mode object 134 133 * ··· 137 136 * by callind drm_mode_object_put(). 138 137 */ 139 138 struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, 139 + struct drm_file *file_priv, 140 140 uint32_t id, uint32_t type) 141 141 { 142 142 struct drm_mode_object *obj = NULL; 143 143 144 - obj = __drm_mode_object_find(dev, id, type); 144 + obj = __drm_mode_object_find(dev, file_priv, id, type); 145 145 return obj; 146 146 } 147 147 EXPORT_SYMBOL(drm_mode_object_find); ··· 361 359 362 360 drm_modeset_lock_all(dev); 363 361 364 - obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type); 362 + obj = drm_mode_object_find(dev, file_priv, arg->obj_id, arg->obj_type); 365 363 if (!obj) { 366 364 ret = -ENOENT; 367 365 goto out; ··· 483 481 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 484 482 return -EINVAL; 485 483 486 - arg_obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type); 484 + arg_obj = drm_mode_object_find(dev, file_priv, arg->obj_id, arg->obj_type); 487 485 if (!arg_obj) 488 486 return -ENOENT; 489 487
+7 -7
drivers/gpu/drm/drm_plane.c
··· 513 513 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 514 514 return -EINVAL; 515 515 516 - plane = drm_plane_find(dev, plane_resp->plane_id); 516 + plane = drm_plane_find(dev, file_priv, plane_resp->plane_id); 517 517 if (!plane) 518 518 return -ENOENT; 519 519 ··· 703 703 * First, find the plane, crtc, and fb objects. If not available, 704 704 * we don't bother to call the driver. 705 705 */ 706 - plane = drm_plane_find(dev, plane_req->plane_id); 706 + plane = drm_plane_find(dev, file_priv, plane_req->plane_id); 707 707 if (!plane) { 708 708 DRM_DEBUG_KMS("Unknown plane ID %d\n", 709 709 plane_req->plane_id); ··· 711 711 } 712 712 713 713 if (plane_req->fb_id) { 714 - fb = drm_framebuffer_lookup(dev, plane_req->fb_id); 714 + fb = drm_framebuffer_lookup(dev, file_priv, plane_req->fb_id); 715 715 if (!fb) { 716 716 DRM_DEBUG_KMS("Unknown framebuffer ID %d\n", 717 717 plane_req->fb_id); 718 718 return -ENOENT; 719 719 } 720 720 721 - crtc = drm_crtc_find(dev, plane_req->crtc_id); 721 + crtc = drm_crtc_find(dev, file_priv, plane_req->crtc_id); 722 722 if (!crtc) { 723 723 drm_framebuffer_put(fb); 724 724 DRM_DEBUG_KMS("Unknown crtc ID %d\n", ··· 829 829 if (!req->flags || (~DRM_MODE_CURSOR_FLAGS & req->flags)) 830 830 return -EINVAL; 831 831 832 - crtc = drm_crtc_find(dev, req->crtc_id); 832 + crtc = drm_crtc_find(dev, file_priv, req->crtc_id); 833 833 if (!crtc) { 834 834 DRM_DEBUG_KMS("Unknown CRTC ID %d\n", req->crtc_id); 835 835 return -ENOENT; ··· 944 944 if ((page_flip->flags & DRM_MODE_PAGE_FLIP_ASYNC) && !dev->mode_config.async_page_flip) 945 945 return -EINVAL; 946 946 947 - crtc = drm_crtc_find(dev, page_flip->crtc_id); 947 + crtc = drm_crtc_find(dev, file_priv, page_flip->crtc_id); 948 948 if (!crtc) 949 949 return -ENOENT; 950 950 ··· 1005 1005 goto out; 1006 1006 } 1007 1007 1008 - fb = drm_framebuffer_lookup(dev, page_flip->fb_id); 1008 + fb = drm_framebuffer_lookup(dev, file_priv, page_flip->fb_id); 1009 1009 if (!fb) { 1010 1010 ret = -ENOENT; 1011 1011 goto out;
+1 -1
drivers/gpu/drm/drm_probe_helper.c
··· 99 99 100 100 /* Step 2: Validate against encoders and crtcs */ 101 101 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { 102 - struct drm_encoder *encoder = drm_encoder_find(dev, ids[i]); 102 + struct drm_encoder *encoder = drm_encoder_find(dev, NULL, ids[i]); 103 103 struct drm_crtc *crtc; 104 104 105 105 if (!encoder)
+3 -3
drivers/gpu/drm/drm_property.c
··· 450 450 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 451 451 return -EINVAL; 452 452 453 - property = drm_property_find(dev, out_resp->prop_id); 453 + property = drm_property_find(dev, file_priv, out_resp->prop_id); 454 454 if (!property) 455 455 return -ENOENT; 456 456 ··· 634 634 struct drm_mode_object *obj; 635 635 struct drm_property_blob *blob = NULL; 636 636 637 - obj = __drm_mode_object_find(dev, id, DRM_MODE_OBJECT_BLOB); 637 + obj = __drm_mode_object_find(dev, NULL, id, DRM_MODE_OBJECT_BLOB); 638 638 if (obj) 639 639 blob = obj_to_blob(obj); 640 640 return blob; ··· 897 897 if (value == 0) 898 898 return true; 899 899 900 - *ref = __drm_mode_object_find(property->dev, value, 900 + *ref = __drm_mode_object_find(property->dev, NULL, value, 901 901 property->values[0]); 902 902 return *ref != NULL; 903 903 }
+1 -1
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
··· 36 36 static struct drm_encoder * 37 37 hibmc_connector_best_encoder(struct drm_connector *connector) 38 38 { 39 - return drm_encoder_find(connector->dev, connector->encoder_ids[0]); 39 + return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]); 40 40 } 41 41 42 42 static const struct drm_connector_helper_funcs
+1 -1
drivers/gpu/drm/i915/intel_display.c
··· 13511 13511 struct drm_crtc *drmmode_crtc; 13512 13512 struct intel_crtc *crtc; 13513 13513 13514 - drmmode_crtc = drm_crtc_find(dev, pipe_from_crtc_id->crtc_id); 13514 + drmmode_crtc = drm_crtc_find(dev, file, pipe_from_crtc_id->crtc_id); 13515 13515 if (!drmmode_crtc) 13516 13516 return -ENOENT; 13517 13517
+1 -1
drivers/gpu/drm/i915/intel_overlay.c
··· 1134 1134 if (!params) 1135 1135 return -ENOMEM; 1136 1136 1137 - drmmode_crtc = drm_crtc_find(dev, put_image_rec->crtc_id); 1137 + drmmode_crtc = drm_crtc_find(dev, file_priv, put_image_rec->crtc_id); 1138 1138 if (!drmmode_crtc) { 1139 1139 ret = -ENOENT; 1140 1140 goto out_free;
+1 -1
drivers/gpu/drm/i915/intel_sprite.c
··· 994 994 set->flags & I915_SET_COLORKEY_DESTINATION) 995 995 return -EINVAL; 996 996 997 - plane = drm_plane_find(dev, set->plane_id); 997 + plane = drm_plane_find(dev, file_priv, set->plane_id); 998 998 if (!plane || plane->type != DRM_PLANE_TYPE_OVERLAY) 999 999 return -ENOENT; 1000 1000
+1 -1
drivers/gpu/drm/mgag200/mgag200_mode.c
··· 1670 1670 int enc_id = connector->encoder_ids[0]; 1671 1671 /* pick the encoder ids */ 1672 1672 if (enc_id) 1673 - return drm_encoder_find(connector->dev, enc_id); 1673 + return drm_encoder_find(connector->dev, NULL, enc_id); 1674 1674 return NULL; 1675 1675 } 1676 1676
+2 -2
drivers/gpu/drm/nouveau/nouveau_connector.c
··· 373 373 if (!id) 374 374 break; 375 375 376 - enc = drm_encoder_find(dev, id); 376 + enc = drm_encoder_find(dev, NULL, id); 377 377 if (!enc) 378 378 continue; 379 379 nv_encoder = nouveau_encoder(enc); ··· 441 441 if (id == 0) 442 442 break; 443 443 444 - encoder = drm_encoder_find(dev, id); 444 + encoder = drm_encoder_find(dev, NULL, id); 445 445 if (!encoder) 446 446 continue; 447 447 nv_encoder = nouveau_encoder(encoder);
+1 -1
drivers/gpu/drm/radeon/r100.c
··· 1456 1456 header = radeon_get_ib_value(p, h_idx); 1457 1457 crtc_id = radeon_get_ib_value(p, h_idx + 5); 1458 1458 reg = R100_CP_PACKET0_GET_REG(header); 1459 - crtc = drm_crtc_find(p->rdev->ddev, crtc_id); 1459 + crtc = drm_crtc_find(p->rdev->ddev, p->filp, crtc_id); 1460 1460 if (!crtc) { 1461 1461 DRM_ERROR("cannot find crtc %d\n", crtc_id); 1462 1462 return -ENOENT;
+1 -1
drivers/gpu/drm/radeon/r600_cs.c
··· 887 887 crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1); 888 888 reg = R600_CP_PACKET0_GET_REG(header); 889 889 890 - crtc = drm_crtc_find(p->rdev->ddev, crtc_id); 890 + crtc = drm_crtc_find(p->rdev->ddev, p->filp, crtc_id); 891 891 if (!crtc) { 892 892 DRM_ERROR("cannot find crtc %d\n", crtc_id); 893 893 return -ENOENT;
+8 -8
drivers/gpu/drm/radeon/radeon_connectors.c
··· 263 263 if (connector->encoder_ids[i] == 0) 264 264 break; 265 265 266 - encoder = drm_encoder_find(connector->dev, 266 + encoder = drm_encoder_find(connector->dev, NULL, 267 267 connector->encoder_ids[i]); 268 268 if (!encoder) 269 269 continue; ··· 290 290 if (connector->encoder_ids[i] == 0) 291 291 break; 292 292 293 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 293 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 294 294 if (!encoder) 295 295 continue; 296 296 ··· 404 404 int enc_id = connector->encoder_ids[0]; 405 405 /* pick the encoder ids */ 406 406 if (enc_id) 407 - return drm_encoder_find(connector->dev, enc_id); 407 + return drm_encoder_find(connector->dev, NULL, enc_id); 408 408 return NULL; 409 409 } 410 410 ··· 1368 1368 if (connector->encoder_ids[i] == 0) 1369 1369 break; 1370 1370 1371 - encoder = drm_encoder_find(connector->dev, 1371 + encoder = drm_encoder_find(connector->dev, NULL, 1372 1372 connector->encoder_ids[i]); 1373 1373 if (!encoder) 1374 1374 continue; ··· 1454 1454 if (connector->encoder_ids[i] == 0) 1455 1455 break; 1456 1456 1457 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 1457 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 1458 1458 if (!encoder) 1459 1459 continue; 1460 1460 ··· 1473 1473 /* then check use digitial */ 1474 1474 /* pick the first one */ 1475 1475 if (enc_id) 1476 - return drm_encoder_find(connector->dev, enc_id); 1476 + return drm_encoder_find(connector->dev, NULL, enc_id); 1477 1477 return NULL; 1478 1478 } 1479 1479 ··· 1620 1620 if (connector->encoder_ids[i] == 0) 1621 1621 break; 1622 1622 1623 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 1623 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 1624 1624 if (!encoder) 1625 1625 continue; 1626 1626 ··· 1649 1649 if (connector->encoder_ids[i] == 0) 1650 1650 break; 1651 1651 1652 - encoder = drm_encoder_find(connector->dev, connector->encoder_ids[i]); 1652 + encoder = drm_encoder_find(connector->dev, NULL, connector->encoder_ids[i]); 1653 1653 if (!encoder) 1654 1654 continue; 1655 1655
+1 -1
drivers/gpu/drm/udl/udl_connector.c
··· 105 105 udl_best_single_encoder(struct drm_connector *connector) 106 106 { 107 107 int enc_id = connector->encoder_ids[0]; 108 - return drm_encoder_find(connector->dev, enc_id); 108 + return drm_encoder_find(connector->dev, NULL, enc_id); 109 109 } 110 110 111 111 static int udl_connector_set_property(struct drm_connector *connector,
+2 -2
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
··· 286 286 287 287 drm_modeset_lock_all(dev); 288 288 289 - fb = drm_framebuffer_lookup(dev, arg->fb_id); 289 + fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); 290 290 if (!fb) { 291 291 DRM_ERROR("Invalid framebuffer id.\n"); 292 292 ret = -ENOENT; ··· 369 369 370 370 drm_modeset_lock_all(dev); 371 371 372 - fb = drm_framebuffer_lookup(dev, arg->fb_id); 372 + fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); 373 373 if (!fb) { 374 374 DRM_ERROR("Invalid framebuffer id.\n"); 375 375 ret = -ENOENT;
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 1726 1726 return 0; 1727 1727 } 1728 1728 1729 - crtc = drm_crtc_find(dev, arg->crtc_id); 1729 + crtc = drm_crtc_find(dev, file_priv, arg->crtc_id); 1730 1730 if (!crtc) { 1731 1731 ret = -ENOENT; 1732 1732 goto out;
+1 -1
drivers/staging/vboxvideo/vbox_mode.c
··· 377 377 378 378 /* pick the encoder ids */ 379 379 if (enc_id) 380 - return drm_encoder_find(connector->dev, enc_id); 380 + return drm_encoder_find(connector->dev, NULL, enc_id); 381 381 382 382 return NULL; 383 383 }
+2 -1
include/drm/drm_connector.h
··· 939 939 * add takes a reference to it. 940 940 */ 941 941 static inline struct drm_connector *drm_connector_lookup(struct drm_device *dev, 942 + struct drm_file *file_priv, 942 943 uint32_t id) 943 944 { 944 945 struct drm_mode_object *mo; 945 - mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_CONNECTOR); 946 + mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_CONNECTOR); 946 947 return mo ? obj_to_connector(mo) : NULL; 947 948 } 948 949
+3 -2
include/drm/drm_crtc.h
··· 959 959 * userspace interface should be done using &drm_property. 960 960 */ 961 961 static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, 962 - uint32_t id) 962 + struct drm_file *file_priv, 963 + uint32_t id) 963 964 { 964 965 struct drm_mode_object *mo; 965 - mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_CRTC); 966 + mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_CRTC); 966 967 return mo ? obj_to_crtc(mo) : NULL; 967 968 } 968 969
+2 -1
include/drm/drm_encoder.h
··· 214 214 * drm_mode_object_find(). 215 215 */ 216 216 static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev, 217 + struct drm_file *file_priv, 217 218 uint32_t id) 218 219 { 219 220 struct drm_mode_object *mo; 220 221 221 - mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_ENCODER); 222 + mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_ENCODER); 222 223 223 224 return mo ? obj_to_encoder(mo) : NULL; 224 225 }
+1
include/drm/drm_framebuffer.h
··· 205 205 struct drm_framebuffer *fb, 206 206 const struct drm_framebuffer_funcs *funcs); 207 207 struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev, 208 + struct drm_file *file_priv, 208 209 uint32_t id); 209 210 void drm_framebuffer_remove(struct drm_framebuffer *fb); 210 211 void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
+2
include/drm/drm_mode_object.h
··· 27 27 struct drm_object_properties; 28 28 struct drm_property; 29 29 struct drm_device; 30 + struct drm_file; 30 31 31 32 /** 32 33 * struct drm_mode_object - base structure for modeset objects ··· 114 113 } 115 114 116 115 struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, 116 + struct drm_file *file_priv, 117 117 uint32_t id, uint32_t type); 118 118 void drm_mode_object_get(struct drm_mode_object *obj); 119 119 void drm_mode_object_put(struct drm_mode_object *obj);
+2 -1
include/drm/drm_plane.h
··· 597 597 * drm_mode_object_find(). 598 598 */ 599 599 static inline struct drm_plane *drm_plane_find(struct drm_device *dev, 600 + struct drm_file *file_priv, 600 601 uint32_t id) 601 602 { 602 603 struct drm_mode_object *mo; 603 - mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_PLANE); 604 + mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_PLANE); 604 605 return mo ? obj_to_plane(mo) : NULL; 605 606 } 606 607
+2 -1
include/drm/drm_property.h
··· 312 312 * This function looks up the property object specified by id and returns it. 313 313 */ 314 314 static inline struct drm_property *drm_property_find(struct drm_device *dev, 315 + struct drm_file *file_priv, 315 316 uint32_t id) 316 317 { 317 318 struct drm_mode_object *mo; 318 - mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_PROPERTY); 319 + mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_PROPERTY); 319 320 return mo ? obj_to_property(mo) : NULL; 320 321 } 321 322