Merge v6.2-rc6 into drm-next
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 31 Jan 2023 10:22:15 +0000 (11:22 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 31 Jan 2023 11:23:23 +0000 (12:23 +0100)
Due to holidays we started -next with more -fixes in-flight than
usual, and people have been asking where they are. Backmerge to get
things better in sync.

Conflicts:
- Tiny conflict in drm_fbdev_generic.c between variable rename and
  missing error handling that got added.
- Conflict in drm_fb_helper.c between the added call to vgaswitcheroo
  in drm_fb_helper_single_fb_probe and a refactor patch that extracted
  lots of helpers and incidentally removed the dev local variable.
  Readd it to make things compile.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
18 files changed:
1  2 
MAINTAINERS
drivers/dma-buf/dma-buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/drm_fbdev_generic.c
drivers/gpu/drm/drm_panel_orientation_quirks.c
drivers/gpu/drm/i915/gem/i915_gem_mman.c
drivers/gpu/drm/i915/gvt/dmabuf.c
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/msm/hdmi/hdmi.c
drivers/gpu/drm/panfrost/panfrost_drv.c
drivers/gpu/drm/tests/Makefile
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vmwgfx/ttm_object.h
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
include/drm/drm_fb_helper.h

diff --cc MAINTAINERS
Simple merge
Simple merge
index 97b34f377fe8ae6c272117346304fe24374f81a9,0d0c26ebab90696a297349af32314807ca5b6f9f..28c428e9c530896c19a37c41bc864c94f3cb4d84
@@@ -1915,52 -1888,17 +1917,53 @@@ static int __drm_fb_helper_find_sizes(s
                return -EAGAIN;
        }
  
 +      return 0;
 +}
 +
 +static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,
 +                                  struct drm_fb_helper_surface_size *sizes)
 +{
 +      struct drm_client_dev *client = &fb_helper->client;
 +      struct drm_device *dev = fb_helper->dev;
 +      struct drm_mode_config *config = &dev->mode_config;
 +      int ret;
 +
 +      mutex_lock(&client->modeset_mutex);
 +      ret = __drm_fb_helper_find_sizes(fb_helper, sizes);
 +      mutex_unlock(&client->modeset_mutex);
 +
 +      if (ret)
 +              return ret;
 +
        /* Handle our overallocation */
 -      sizes.surface_height *= drm_fbdev_overalloc;
 -      sizes.surface_height /= 100;
 -      if (sizes.surface_height > config->max_height) {
 +      sizes->surface_height *= drm_fbdev_overalloc;
 +      sizes->surface_height /= 100;
 +      if (sizes->surface_height > config->max_height) {
                drm_dbg_kms(dev, "Fbdev over-allocation too large; clamping height to %d\n",
                            config->max_height);
 -              sizes.surface_height = config->max_height;
 +              sizes->surface_height = config->max_height;
 +      }
 +
 +      return 0;
 +}
 +
 +/*
 + * Allocates the backing storage and sets up the fbdev info structure through
 + * the ->fb_probe callback.
 + */
 +static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
 +{
 +      struct drm_client_dev *client = &fb_helper->client;
++      struct drm_device *dev = fb_helper->dev;
 +      struct drm_fb_helper_surface_size sizes;
 +      int ret;
 +
 +      ret = drm_fb_helper_find_sizes(fb_helper, &sizes);
 +      if (ret) {
 +              /* First time: disable all crtc's.. */
 +              if (!fb_helper->deferred_setup)
 +                      drm_client_modeset_commit(client);
 +              return ret;
        }
  
  #if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM)
index 43f94aa9e01525a70f45f54b0577e52e2c4f4e92,593aa3283792b607066476c99c8c6c476ab3a22b..365f80717fa130412d6ecf67c06b05d5fdfc87ef
@@@ -189,25 -200,31 +184,31 @@@ static int drm_fbdev_fb_probe(struct dr
        fb_helper->fb = buffer->fb;
        fb = buffer->fb;
  
 -      fbi = drm_fb_helper_alloc_info(fb_helper);
 -      if (IS_ERR(fbi))
 -              return PTR_ERR(fbi);
 +      info = drm_fb_helper_alloc_info(fb_helper);
 +      if (IS_ERR(info))
 +              return PTR_ERR(info);
  
 -      fbi->fbops = &drm_fbdev_fb_ops;
 -      fbi->screen_size = sizes->surface_height * fb->pitches[0];
 -      fbi->fix.smem_len = fbi->screen_size;
 -      fbi->flags = FBINFO_DEFAULT;
 +      info->fbops = &drm_fbdev_fb_ops;
 +      info->screen_size = sizes->surface_height * fb->pitches[0];
 +      info->fix.smem_len = info->screen_size;
 +      info->flags = FBINFO_DEFAULT;
  
 -      drm_fb_helper_fill_info(fbi, fb_helper, sizes);
 +      drm_fb_helper_fill_info(info, fb_helper, sizes);
  
        if (drm_fbdev_use_shadow_fb(fb_helper)) {
 -              fbi->screen_buffer = vzalloc(fbi->screen_size);
 -              if (!fbi->screen_buffer)
 +              info->screen_buffer = vzalloc(info->screen_size);
 +              if (!info->screen_buffer)
                        return -ENOMEM;
 -              fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
 +              info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
  
-               info->fbdefio = &drm_fbdev_defio;
-               fb_deferred_io_init(info);
+               /* Set a default deferred I/O handler */
+               fb_helper->fbdefio.delay = HZ / 20;
+               fb_helper->fbdefio.deferred_io = drm_fb_helper_deferred_io;
 -              fbi->fbdefio = &fb_helper->fbdefio;
 -              ret = fb_deferred_io_init(fbi);
++              info->fbdefio = &fb_helper->fbdefio;
++              ret = fb_deferred_io_init(info);
+               if (ret)
+                       return ret;
        } else {
                /* buffer is mapped for HW framebuffer */
                ret = drm_client_buffer_vmap(fb_helper->buffer, &map);
Simple merge
Simple merge
Simple merge
index aaf357e29c656bea11bdbbaff18f1517aebf0ee1,f896ef85c2f2b2503a72c5a0d56e9c22aac2c1cb..bca726a8f483241c4ee305e75a403e1978f199c0
@@@ -12,9 -8,9 +12,11 @@@ obj-$(CONFIG_DRM_KUNIT_TEST) += 
        drm_format_helper_test.o \
        drm_format_test.o \
        drm_framebuffer_test.o \
 -      drm_kunit_helpers.o \
 +      drm_managed_test.o \
        drm_mm_test.o \
 +      drm_modes_test.o \
        drm_plane_helper_test.o \
 +      drm_probe_helper_test.o \
        drm_rect_test.o
+ CFLAGS_drm_mm_test.o := $(DISABLE_STRUCTLEAK_PLUGIN)
Simple merge
Simple merge
index 95a9679f9d396de464e8fac07fc461c3ac1c160d,8098a3846bae3e4f1c1626230dcc9d68141c56ae..e6b77ee33e559b048ca35cac68a778d569c8adb3
@@@ -309,27 -307,4 +309,12 @@@ extern int ttm_prime_handle_to_fd(struc
  #define ttm_prime_object_kfree(__obj, __prime)                \
        kfree_rcu(__obj, __prime.base.rhead)
  
- struct ttm_base_object *
- ttm_base_object_noref_lookup(struct ttm_object_file *tfile, uint64_t key);
- /**
-  * ttm_base_object_noref_release - release a base object pointer looked up
-  * without reference
-  *
-  * Releases a base object pointer looked up with ttm_base_object_noref_lookup().
-  */
- static inline void ttm_base_object_noref_release(void)
- {
-       __acquire(RCU);
-       rcu_read_unlock();
- }
 +static inline int ttm_bo_wait(struct ttm_buffer_object *bo, bool intr,
 +                            bool no_wait)
 +{
 +      struct ttm_operation_ctx ctx = { intr, no_wait };
 +
 +      return ttm_bo_wait_ctx(bo, &ctx);
 +}
 +
  #endif
Simple merge
Simple merge