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

Merge tag 'drm-misc-next-fixes-2025-08-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

Short summary of fixes pull:

bridge:
- fix OF-node leak
- fix documentation

fbdev-emulation:
- pass correct format info to drm_helper_mode_fill_fb_struct()

panfrost:
- print correct RSS size

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250812064712.GA14554@2a02-2454-fd5e-fd00-2c49-c639-c55f-a125.dyn6.pyur.net

+85 -28
+2
drivers/gpu/drm/bridge/aux-bridge.c
··· 18 18 { 19 19 struct auxiliary_device *adev = to_auxiliary_dev(dev); 20 20 21 + of_node_put(dev->of_node); 21 22 ida_free(&drm_aux_bridge_ida, adev->id); 22 23 23 24 kfree(adev); ··· 66 65 67 66 ret = auxiliary_device_init(adev); 68 67 if (ret) { 68 + of_node_put(adev->dev.of_node); 69 69 ida_free(&drm_aux_bridge_ida, adev->id); 70 70 kfree(adev); 71 71 return ret;
+1
drivers/gpu/drm/drm_bridge.c
··· 1227 1227 /** 1228 1228 * drm_bridge_detect - check if anything is attached to the bridge output 1229 1229 * @bridge: bridge control structure 1230 + * @connector: attached connector 1230 1231 * 1231 1232 * If the bridge supports output detection, as reported by the 1232 1233 * DRM_BRIDGE_OP_DETECT bridge ops flag, call &drm_bridge_funcs.detect for the
+3 -6
drivers/gpu/drm/nouveau/nouveau_display.c
··· 253 253 254 254 int 255 255 nouveau_framebuffer_new(struct drm_device *dev, 256 + const struct drm_format_info *info, 256 257 const struct drm_mode_fb_cmd2 *mode_cmd, 257 258 struct drm_gem_object *gem, 258 259 struct drm_framebuffer **pfb) ··· 261 260 struct nouveau_drm *drm = nouveau_drm(dev); 262 261 struct nouveau_bo *nvbo = nouveau_gem_object(gem); 263 262 struct drm_framebuffer *fb; 264 - const struct drm_format_info *info; 265 263 unsigned int height, i; 266 264 uint32_t tile_mode; 267 265 uint8_t kind; ··· 295 295 kind = nvbo->kind; 296 296 } 297 297 298 - info = drm_get_format_info(dev, mode_cmd->pixel_format, 299 - mode_cmd->modifier[0]); 300 - 301 298 for (i = 0; i < info->num_planes; i++) { 302 299 height = drm_format_info_plane_height(info, 303 300 mode_cmd->height, ··· 318 321 if (!(fb = *pfb = kzalloc(sizeof(*fb), GFP_KERNEL))) 319 322 return -ENOMEM; 320 323 321 - drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd); 324 + drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd); 322 325 fb->obj[0] = gem; 323 326 324 327 ret = drm_framebuffer_init(dev, fb, &nouveau_framebuffer_funcs); ··· 341 344 if (!gem) 342 345 return ERR_PTR(-ENOENT); 343 346 344 - ret = nouveau_framebuffer_new(dev, mode_cmd, gem, &fb); 347 + ret = nouveau_framebuffer_new(dev, info, mode_cmd, gem, &fb); 345 348 if (ret == 0) 346 349 return fb; 347 350
+3
drivers/gpu/drm/nouveau/nouveau_display.h
··· 8 8 9 9 #include <drm/drm_framebuffer.h> 10 10 11 + struct drm_format_info; 12 + 11 13 int 12 14 nouveau_framebuffer_new(struct drm_device *dev, 15 + const struct drm_format_info *info, 13 16 const struct drm_mode_fb_cmd2 *mode_cmd, 14 17 struct drm_gem_object *gem, 15 18 struct drm_framebuffer **pfb);
+10 -13
drivers/gpu/drm/omapdrm/omap_fb.c
··· 351 351 } 352 352 } 353 353 354 - fb = omap_framebuffer_init(dev, mode_cmd, bos); 354 + fb = omap_framebuffer_init(dev, info, mode_cmd, bos); 355 355 if (IS_ERR(fb)) 356 356 goto error; 357 357 ··· 365 365 } 366 366 367 367 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, 368 + const struct drm_format_info *info, 368 369 const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) 369 370 { 370 - const struct drm_format_info *format = NULL; 371 371 struct omap_framebuffer *omap_fb = NULL; 372 372 struct drm_framebuffer *fb = NULL; 373 373 unsigned int pitch = mode_cmd->pitches[0]; ··· 377 377 dev, mode_cmd, mode_cmd->width, mode_cmd->height, 378 378 (char *)&mode_cmd->pixel_format); 379 379 380 - format = drm_get_format_info(dev, mode_cmd->pixel_format, 381 - mode_cmd->modifier[0]); 382 - 383 380 for (i = 0; i < ARRAY_SIZE(formats); i++) { 384 381 if (formats[i] == mode_cmd->pixel_format) 385 382 break; 386 383 } 387 384 388 - if (!format || i == ARRAY_SIZE(formats)) { 385 + if (i == ARRAY_SIZE(formats)) { 389 386 dev_dbg(dev->dev, "unsupported pixel format: %4.4s\n", 390 387 (char *)&mode_cmd->pixel_format); 391 388 ret = -EINVAL; ··· 396 399 } 397 400 398 401 fb = &omap_fb->base; 399 - omap_fb->format = format; 402 + omap_fb->format = info; 400 403 mutex_init(&omap_fb->lock); 401 404 402 405 /* ··· 404 407 * that the two planes of multiplane formats need the same number of 405 408 * bytes per pixel. 406 409 */ 407 - if (format->num_planes == 2 && pitch != mode_cmd->pitches[1]) { 410 + if (info->num_planes == 2 && pitch != mode_cmd->pitches[1]) { 408 411 dev_dbg(dev->dev, "pitches differ between planes 0 and 1\n"); 409 412 ret = -EINVAL; 410 413 goto fail; 411 414 } 412 415 413 - if (pitch % format->cpp[0]) { 416 + if (pitch % info->cpp[0]) { 414 417 dev_dbg(dev->dev, 415 418 "buffer pitch (%u bytes) is not a multiple of pixel size (%u bytes)\n", 416 - pitch, format->cpp[0]); 419 + pitch, info->cpp[0]); 417 420 ret = -EINVAL; 418 421 goto fail; 419 422 } 420 423 421 - for (i = 0; i < format->num_planes; i++) { 424 + for (i = 0; i < info->num_planes; i++) { 422 425 struct plane *plane = &omap_fb->planes[i]; 423 - unsigned int vsub = i == 0 ? 1 : format->vsub; 426 + unsigned int vsub = i == 0 ? 1 : info->vsub; 424 427 unsigned int size; 425 428 426 429 size = pitch * mode_cmd->height / vsub; ··· 437 440 plane->dma_addr = 0; 438 441 } 439 442 440 - drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd); 443 + drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd); 441 444 442 445 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs); 443 446 if (ret) {
+2
drivers/gpu/drm/omapdrm/omap_fb.h
··· 13 13 struct drm_device; 14 14 struct drm_file; 15 15 struct drm_framebuffer; 16 + struct drm_format_info; 16 17 struct drm_gem_object; 17 18 struct drm_mode_fb_cmd2; 18 19 struct drm_plane_state; ··· 24 23 struct drm_file *file, const struct drm_format_info *info, 25 24 const struct drm_mode_fb_cmd2 *mode_cmd); 26 25 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, 26 + const struct drm_format_info *info, 27 27 const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); 28 28 int omap_framebuffer_pin(struct drm_framebuffer *fb); 29 29 void omap_framebuffer_unpin(struct drm_framebuffer *fb);
+4 -1
drivers/gpu/drm/omapdrm/omap_fbdev.c
··· 197 197 goto fail; 198 198 } 199 199 200 - fb = omap_framebuffer_init(dev, &mode_cmd, &bo); 200 + fb = omap_framebuffer_init(dev, 201 + drm_get_format_info(dev, mode_cmd.pixel_format, 202 + mode_cmd.modifier[0]), 203 + &mode_cmd, &bo); 201 204 if (IS_ERR(fb)) { 202 205 dev_err(dev->dev, "failed to allocate fb\n"); 203 206 /* note: if fb creation failed, we can't rely on fb destroy
+1 -1
drivers/gpu/drm/panfrost/panfrost_gem.c
··· 432 432 if (!refcount) 433 433 return; 434 434 435 - resident_size = bo->base.pages ? bo->base.base.size : 0; 435 + resident_size = panfrost_gem_rss(&bo->base.base); 436 436 437 437 snprintf(creator_info, sizeof(creator_info), 438 438 "%s/%d", bo->debugfs.creator.process_name, bo->debugfs.creator.tgid);
+3 -2
drivers/gpu/drm/radeon/radeon_display.c
··· 1297 1297 int 1298 1298 radeon_framebuffer_init(struct drm_device *dev, 1299 1299 struct drm_framebuffer *fb, 1300 + const struct drm_format_info *info, 1300 1301 const struct drm_mode_fb_cmd2 *mode_cmd, 1301 1302 struct drm_gem_object *obj) 1302 1303 { 1303 1304 int ret; 1304 1305 fb->obj[0] = obj; 1305 - drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd); 1306 + drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd); 1306 1307 ret = drm_framebuffer_init(dev, fb, &radeon_fb_funcs); 1307 1308 if (ret) { 1308 1309 fb->obj[0] = NULL; ··· 1342 1341 return ERR_PTR(-ENOMEM); 1343 1342 } 1344 1343 1345 - ret = radeon_framebuffer_init(dev, fb, mode_cmd, obj); 1344 + ret = radeon_framebuffer_init(dev, fb, info, mode_cmd, obj); 1346 1345 if (ret) { 1347 1346 kfree(fb); 1348 1347 drm_gem_object_put(obj);
+6 -5
drivers/gpu/drm/radeon/radeon_fbdev.c
··· 53 53 } 54 54 55 55 static int radeon_fbdev_create_pinned_object(struct drm_fb_helper *fb_helper, 56 + const struct drm_format_info *info, 56 57 struct drm_mode_fb_cmd2 *mode_cmd, 57 58 struct drm_gem_object **gobj_p) 58 59 { 59 - const struct drm_format_info *info; 60 60 struct radeon_device *rdev = fb_helper->dev->dev_private; 61 61 struct drm_gem_object *gobj = NULL; 62 62 struct radeon_bo *rbo = NULL; ··· 67 67 int height = mode_cmd->height; 68 68 u32 cpp; 69 69 70 - info = drm_get_format_info(rdev_to_drm(rdev), mode_cmd->pixel_format, 71 - mode_cmd->modifier[0]); 72 70 cpp = info->cpp[0]; 73 71 74 72 /* need to align pitch with crtc limits */ ··· 204 206 struct drm_fb_helper_surface_size *sizes) 205 207 { 206 208 struct radeon_device *rdev = fb_helper->dev->dev_private; 209 + const struct drm_format_info *format_info; 207 210 struct drm_mode_fb_cmd2 mode_cmd = { }; 208 211 struct fb_info *info; 209 212 struct drm_gem_object *gobj; ··· 223 224 mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, 224 225 sizes->surface_depth); 225 226 226 - ret = radeon_fbdev_create_pinned_object(fb_helper, &mode_cmd, &gobj); 227 + format_info = drm_get_format_info(rdev_to_drm(rdev), mode_cmd.pixel_format, 228 + mode_cmd.modifier[0]); 229 + ret = radeon_fbdev_create_pinned_object(fb_helper, format_info, &mode_cmd, &gobj); 227 230 if (ret) { 228 231 DRM_ERROR("failed to create fbcon object %d\n", ret); 229 232 return ret; ··· 237 236 ret = -ENOMEM; 238 237 goto err_radeon_fbdev_destroy_pinned_object; 239 238 } 240 - ret = radeon_framebuffer_init(rdev_to_drm(rdev), fb, &mode_cmd, gobj); 239 + ret = radeon_framebuffer_init(rdev_to_drm(rdev), fb, format_info, &mode_cmd, gobj); 241 240 if (ret) { 242 241 DRM_ERROR("failed to initialize framebuffer %d\n", ret); 243 242 goto err_kfree;
+2
drivers/gpu/drm/radeon/radeon_mode.h
··· 40 40 41 41 struct drm_fb_helper; 42 42 struct drm_fb_helper_surface_size; 43 + struct drm_format_info; 43 44 44 45 struct edid; 45 46 struct drm_edid; ··· 891 890 radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on); 892 891 int radeon_framebuffer_init(struct drm_device *dev, 893 892 struct drm_framebuffer *rfb, 893 + const struct drm_format_info *info, 894 894 const struct drm_mode_fb_cmd2 *mode_cmd, 895 895 struct drm_gem_object *obj); 896 896
+48
include/drm/drm_bridge.h
··· 866 866 struct drm_connector *connector, 867 867 bool enable, int direction); 868 868 869 + /** 870 + * @hdmi_cec_init: 871 + * 872 + * Initialize CEC part of the bridge. 873 + * 874 + * This callback is optional, it can be implemented by bridges that 875 + * set the @DRM_BRIDGE_OP_HDMI_CEC_ADAPTER flag in their 876 + * &drm_bridge->ops. 877 + * 878 + * Returns: 879 + * 0 on success, a negative error code otherwise 880 + */ 869 881 int (*hdmi_cec_init)(struct drm_bridge *bridge, 870 882 struct drm_connector *connector); 871 883 884 + /** 885 + * @hdmi_cec_enable: 886 + * 887 + * Enable or disable the CEC adapter inside the bridge. 888 + * 889 + * This callback is optional, it can be implemented by bridges that 890 + * set the @DRM_BRIDGE_OP_HDMI_CEC_ADAPTER flag in their 891 + * &drm_bridge->ops. 892 + * 893 + * Returns: 894 + * 0 on success, a negative error code otherwise 895 + */ 872 896 int (*hdmi_cec_enable)(struct drm_bridge *bridge, bool enable); 873 897 898 + /** 899 + * @hdmi_cec_log_addr: 900 + * 901 + * Set the logical address of the CEC adapter inside the bridge. 902 + * 903 + * This callback is optional, it can be implemented by bridges that 904 + * set the @DRM_BRIDGE_OP_HDMI_CEC_ADAPTER flag in their 905 + * &drm_bridge->ops. 906 + * 907 + * Returns: 908 + * 0 on success, a negative error code otherwise 909 + */ 874 910 int (*hdmi_cec_log_addr)(struct drm_bridge *bridge, u8 logical_addr); 875 911 912 + /** 913 + * @hdmi_cec_transmit: 914 + * 915 + * Transmit the message using the CEC adapter inside the bridge. 916 + * 917 + * This callback is optional, it can be implemented by bridges that 918 + * set the @DRM_BRIDGE_OP_HDMI_CEC_ADAPTER flag in their 919 + * &drm_bridge->ops. 920 + * 921 + * Returns: 922 + * 0 on success, a negative error code otherwise 923 + */ 876 924 int (*hdmi_cec_transmit)(struct drm_bridge *bridge, u8 attempts, 877 925 u32 signal_free_time, struct cec_msg *msg); 878 926