History

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>

Dave Airlie committed 1 year ago

Commit f858f632 parents 8f5ae30 54d4f4412 files · +85 −28Browse files

Unified · Split

12 files
  1. drivers/gpu/drm/bridge/aux-bridge.c +2 −0
  2. drivers/gpu/drm/drm_bridge.c +1 −0
  3. drivers/gpu/drm/nouveau/nouveau_display.c +3 −6
  4. drivers/gpu/drm/nouveau/nouveau_display.h +3 −0
  5. drivers/gpu/drm/omapdrm/omap_fb.c +10 −13
  6. drivers/gpu/drm/omapdrm/omap_fb.h +2 −0
  7. drivers/gpu/drm/omapdrm/omap_fbdev.c +4 −1
  8. drivers/gpu/drm/panfrost/panfrost_gem.c +1 −1
  9. drivers/gpu/drm/radeon/radeon_display.c +3 −2
  10. drivers/gpu/drm/radeon/radeon_fbdev.c +6 −5
  11. drivers/gpu/drm/radeon/radeon_mode.h +2 −0
  12. include/drm/drm_bridge.h +48 −0
drivers/gpu/drm/bridge/aux-bridge.c+2−0
@@ -18,6 +18,7 @@ static void drm_aux_bridge_release(struct device *dev) · 17 unmodified lines
1818 {
1919 struct auxiliary_device *adev = to_auxiliary_dev(dev);
2020
21+ of_node_put(dev->of_node);
2122 ida_free(&drm_aux_bridge_ida, adev->id);
2223
2324 kfree(adev);
@@ -65,6 +66,7 @@ int drm_aux_bridge_register(struct device *parent) · 41 unmodified lines
6566
6667 ret = auxiliary_device_init(adev);
6768 if (ret) {
69+ of_node_put(adev->dev.of_node);
6870 ida_free(&drm_aux_bridge_ida, adev->id);
6971 kfree(adev);
7072 return ret;
drivers/gpu/drm/drm_bridge.c+1−0
@@ -1227,6 +1227,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_check); · 1226 unmodified lines
12271227 /**
12281228 * drm_bridge_detect - check if anything is attached to the bridge output
12291229 * @bridge: bridge control structure
1230+ * @connector: attached connector
12301231 *
12311232 * If the bridge supports output detection, as reported by the
12321233 * DRM_BRIDGE_OP_DETECT bridge ops flag, call &drm_bridge_funcs.detect for the
drivers/gpu/drm/nouveau/nouveau_display.c+3−6
@@ -253,6 +253,7 @@ nouveau_check_bl_size(struct nouveau_drm *drm, struct nouveau_bo *nvbo, · 252 unmodified lines
253253
254254 int
255255 nouveau_framebuffer_new(struct drm_device *dev,
256+ const struct drm_format_info *info,
256257 const struct drm_mode_fb_cmd2 *mode_cmd,
257258 struct drm_gem_object *gem,
258259 struct drm_framebuffer **pfb)
@@ -260,7 +261,6 @@ nouveau_framebuffer_new(struct drm_device *dev, · 1 unmodified line
260261 struct nouveau_drm *drm = nouveau_drm(dev);
261262 struct nouveau_bo *nvbo = nouveau_gem_object(gem);
262263 struct drm_framebuffer *fb;
263− const struct drm_format_info *info;
264264 unsigned int height, i;
265265 uint32_t tile_mode;
266266 uint8_t kind;
@@ -295,9 +295,6 @@ nouveau_framebuffer_new(struct drm_device *dev, · 28 unmodified lines
295295 kind = nvbo->kind;
296296 }
297297
298− info = drm_get_format_info(dev, mode_cmd->pixel_format,
299− mode_cmd->modifier[0]);
300−
301298 for (i = 0; i < info->num_planes; i++) {
302299 height = drm_format_info_plane_height(info,
303300 mode_cmd->height,
@@ -321,7 +318,7 @@ nouveau_framebuffer_new(struct drm_device *dev, · 17 unmodified lines
321318 if (!(fb = *pfb = kzalloc(sizeof(*fb), GFP_KERNEL)))
322319 return -ENOMEM;
323320
324− drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd);
321+ drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
325322 fb->obj[0] = gem;
326323
327324 ret = drm_framebuffer_init(dev, fb, &nouveau_framebuffer_funcs);
@@ -344,7 +341,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev, · 16 unmodified lines
344341 if (!gem)
345342 return ERR_PTR(-ENOENT);
346343
347− ret = nouveau_framebuffer_new(dev, mode_cmd, gem, &fb);
344+ ret = nouveau_framebuffer_new(dev, info, mode_cmd, gem, &fb);
348345 if (ret == 0)
349346 return fb;
350347
drivers/gpu/drm/nouveau/nouveau_display.h+3−0
@@ -8,8 +8,11 @@ · 7 unmodified lines
88
99 #include <drm/drm_framebuffer.h>
1010
11+struct drm_format_info;
12+
1113 int
1214 nouveau_framebuffer_new(struct drm_device *dev,
15+ const struct drm_format_info *info,
1316 const struct drm_mode_fb_cmd2 *mode_cmd,
1417 struct drm_gem_object *gem,
1518 struct drm_framebuffer **pfb);
drivers/gpu/drm/omapdrm/omap_fb.c+10−13
@@ -351,7 +351,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, · 350 unmodified lines
351351 }
352352 }
353353
354− fb = omap_framebuffer_init(dev, mode_cmd, bos);
354+ fb = omap_framebuffer_init(dev, info, mode_cmd, bos);
355355 if (IS_ERR(fb))
356356 goto error;
357357
@@ -365,9 +365,9 @@ error: · 7 unmodified lines
365365 }
366366
367367 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
368+ const struct drm_format_info *info,
368369 const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos)
369370 {
370− const struct drm_format_info *format = NULL;
371371 struct omap_framebuffer *omap_fb = NULL;
372372 struct drm_framebuffer *fb = NULL;
373373 unsigned int pitch = mode_cmd->pitches[0];
@@ -377,15 +377,12 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, · 3 unmodified lines
377377 dev, mode_cmd, mode_cmd->width, mode_cmd->height,
378378 (char *)&mode_cmd->pixel_format);
379379
380− format = drm_get_format_info(dev, mode_cmd->pixel_format,
381− mode_cmd->modifier[0]);
382−
383380 for (i = 0; i < ARRAY_SIZE(formats); i++) {
384381 if (formats[i] == mode_cmd->pixel_format)
385382 break;
386383 }
387384
388− if (!format || i == ARRAY_SIZE(formats)) {
385+ if (i == ARRAY_SIZE(formats)) {
389386 dev_dbg(dev->dev, "unsupported pixel format: %4.4s\n",
390387 (char *)&mode_cmd->pixel_format);
391388 ret = -EINVAL;
@@ -399,7 +396,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, · 7 unmodified lines
399396 }
400397
401398 fb = &omap_fb->base;
402− omap_fb->format = format;
399+ omap_fb->format = info;
403400 mutex_init(&omap_fb->lock);
404401
405402 /*
@@ -407,23 +404,23 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, · 1 unmodified line
407404 * that the two planes of multiplane formats need the same number of
408405 * bytes per pixel.
409406 */
410− if (format->num_planes == 2 && pitch != mode_cmd->pitches[1]) {
407+ if (info->num_planes == 2 && pitch != mode_cmd->pitches[1]) {
411408 dev_dbg(dev->dev, "pitches differ between planes 0 and 1\n");
412409 ret = -EINVAL;
413410 goto fail;
414411 }
415412
416− if (pitch % format->cpp[0]) {
413+ if (pitch % info->cpp[0]) {
417414 dev_dbg(dev->dev,
418415 "buffer pitch (%u bytes) is not a multiple of pixel size (%u bytes)\n",
419− pitch, format->cpp[0]);
416+ pitch, info->cpp[0]);
420417 ret = -EINVAL;
421418 goto fail;
422419 }
423420
424− for (i = 0; i < format->num_planes; i++) {
421+ for (i = 0; i < info->num_planes; i++) {
425422 struct plane *plane = &omap_fb->planes[i];
426− unsigned int vsub = i == 0 ? 1 : format->vsub;
423+ unsigned int vsub = i == 0 ? 1 : info->vsub;
427424 unsigned int size;
428425
429426 size = pitch * mode_cmd->height / vsub;
@@ -440,7 +437,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, · 10 unmodified lines
440437 plane->dma_addr = 0;
441438 }
442439
443− drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd);
440+ drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
444441
445442 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs);
446443 if (ret) {
drivers/gpu/drm/omapdrm/omap_fb.h+2−0
@@ -13,6 +13,7 @@ struct drm_connector; · 12 unmodified lines
1313 struct drm_device;
1414 struct drm_file;
1515 struct drm_framebuffer;
16+struct drm_format_info;
1617 struct drm_gem_object;
1718 struct drm_mode_fb_cmd2;
1819 struct drm_plane_state;
@@ -23,6 +24,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, · 4 unmodified lines
2324 struct drm_file *file, const struct drm_format_info *info,
2425 const struct drm_mode_fb_cmd2 *mode_cmd);
2526 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
27+ const struct drm_format_info *info,
2628 const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos);
2729 int omap_framebuffer_pin(struct drm_framebuffer *fb);
2830 void omap_framebuffer_unpin(struct drm_framebuffer *fb);
drivers/gpu/drm/omapdrm/omap_fbdev.c+4−1
@@ -197,7 +197,10 @@ int omap_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper, · 196 unmodified lines
197197 goto fail;
198198 }
199199
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);
201204 if (IS_ERR(fb)) {
202205 dev_err(dev->dev, "failed to allocate fb\n");
203206 /* note: if fb creation failed, we can't rely on fb destroy
drivers/gpu/drm/panfrost/panfrost_gem.c+1−1
@@ -432,7 +432,7 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo, · 431 unmodified lines
432432 if (!refcount)
433433 return;
434434
435− resident_size = bo->base.pages ? bo->base.base.size : 0;
435+ resident_size = panfrost_gem_rss(&bo->base.base);
436436
437437 snprintf(creator_info, sizeof(creator_info),
438438 "%s/%d", bo->debugfs.creator.process_name, bo->debugfs.creator.tgid);
drivers/gpu/drm/radeon/radeon_display.c+3−2
@@ -1297,12 +1297,13 @@ static const struct drm_framebuffer_funcs radeon_fb_funcs = { · 1296 unmodified lines
12971297 int
12981298 radeon_framebuffer_init(struct drm_device *dev,
12991299 struct drm_framebuffer *fb,
1300+ const struct drm_format_info *info,
13001301 const struct drm_mode_fb_cmd2 *mode_cmd,
13011302 struct drm_gem_object *obj)
13021303 {
13031304 int ret;
13041305 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);
13061307 ret = drm_framebuffer_init(dev, fb, &radeon_fb_funcs);
13071308 if (ret) {
13081309 fb->obj[0] = NULL;
@@ -1341,7 +1342,7 @@ radeon_user_framebuffer_create(struct drm_device *dev, · 32 unmodified lines
13411342 return ERR_PTR(-ENOMEM);
13421343 }
13431344
1344− ret = radeon_framebuffer_init(dev, fb, mode_cmd, obj);
1345+ ret = radeon_framebuffer_init(dev, fb, info, mode_cmd, obj);
13451346 if (ret) {
13461347 kfree(fb);
13471348 drm_gem_object_put(obj);
drivers/gpu/drm/radeon/radeon_fbdev.c+6−5
@@ -53,10 +53,10 @@ static void radeon_fbdev_destroy_pinned_object(struct drm_gem_object *gobj) · 52 unmodified lines
5353 }
5454
5555 static int radeon_fbdev_create_pinned_object(struct drm_fb_helper *fb_helper,
56+ const struct drm_format_info *info,
5657 struct drm_mode_fb_cmd2 *mode_cmd,
5758 struct drm_gem_object **gobj_p)
5859 {
59− const struct drm_format_info *info;
6060 struct radeon_device *rdev = fb_helper->dev->dev_private;
6161 struct drm_gem_object *gobj = NULL;
6262 struct radeon_bo *rbo = NULL;
@@ -67,8 +67,6 @@ static int radeon_fbdev_create_pinned_object(struct drm_fb_helper *fb_helper, · 4 unmodified lines
6767 int height = mode_cmd->height;
6868 u32 cpp;
6969
70− info = drm_get_format_info(rdev_to_drm(rdev), mode_cmd->pixel_format,
71− mode_cmd->modifier[0]);
7270 cpp = info->cpp[0];
7371
7472 /* need to align pitch with crtc limits */
@@ -206,6 +204,7 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper *fb_helper, · 131 unmodified lines
206204 struct drm_fb_helper_surface_size *sizes)
207205 {
208206 struct radeon_device *rdev = fb_helper->dev->dev_private;
207+ const struct drm_format_info *format_info;
209208 struct drm_mode_fb_cmd2 mode_cmd = { };
210209 struct fb_info *info;
211210 struct drm_gem_object *gobj;
@@ -224,7 +223,9 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper *fb_helper, · 12 unmodified lines
224223 mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
225224 sizes->surface_depth);
226225
227− ret = radeon_fbdev_create_pinned_object(fb_helper, &mode_cmd, &gobj);
226+ format_info = drm_get_format_info(rdev_to_drm(rdev), mode_cmd.pixel_format,
227+ mode_cmd.modifier[0]);
228+ ret = radeon_fbdev_create_pinned_object(fb_helper, format_info, &mode_cmd, &gobj);
228229 if (ret) {
229230 DRM_ERROR("failed to create fbcon object %d\n", ret);
230231 return ret;
@@ -236,7 +237,7 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper *fb_helper, · 5 unmodified lines
236237 ret = -ENOMEM;
237238 goto err_radeon_fbdev_destroy_pinned_object;
238239 }
239− ret = radeon_framebuffer_init(rdev_to_drm(rdev), fb, &mode_cmd, gobj);
240+ ret = radeon_framebuffer_init(rdev_to_drm(rdev), fb, format_info, &mode_cmd, gobj);
240241 if (ret) {
241242 DRM_ERROR("failed to initialize framebuffer %d\n", ret);
242243 goto err_kfree;
drivers/gpu/drm/radeon/radeon_mode.h+2−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040
4141 struct drm_fb_helper;
4242 struct drm_fb_helper_surface_size;
43+struct drm_format_info;
4344
4445 struct edid;
4546 struct drm_edid;
@@ -890,6 +891,7 @@ extern void · 844 unmodified lines
890891 radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on);
891892 int radeon_framebuffer_init(struct drm_device *dev,
892893 struct drm_framebuffer *rfb,
894+ const struct drm_format_info *info,
893895 const struct drm_mode_fb_cmd2 *mode_cmd,
894896 struct drm_gem_object *obj);
895897
include/drm/drm_bridge.h+48−0
@@ -866,13 +866,61 @@ struct drm_bridge_funcs { · 865 unmodified lines
866866 struct drm_connector *connector,
867867 bool enable, int direction);
868868
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+ */
869881 int (*hdmi_cec_init)(struct drm_bridge *bridge,
870882 struct drm_connector *connector);
871883
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+ */
872896 int (*hdmi_cec_enable)(struct drm_bridge *bridge, bool enable);
873897
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+ */
874910 int (*hdmi_cec_log_addr)(struct drm_bridge *bridge, u8 logical_addr);
875911
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+ */
876924 int (*hdmi_cec_transmit)(struct drm_bridge *bridge, u8 attempts,
877925 u32 signal_free_time, struct cec_msg *msg);
878926

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t