1. 20 Apr, 2023 20 commits
  2. 19 Apr, 2023 2 commits
  3. 17 Apr, 2023 14 commits
  4. 16 Apr, 2023 4 commits
    • Thomas Zimmermann's avatar
      Merge drm/drm-next into drm-misc-next · 7f6f26d7
      Thomas Zimmermann authored
      Backmerging drm-next to sync with msm tree. Resolves a conflict
      between aperture-helper changes and msm's use of those interfaces.
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      7f6f26d7
    • Thomas Zimmermann's avatar
      video/aperture: Provide a VGA helper for gma500 and internal use · 116b1c5a
      Thomas Zimmermann authored
      The hardware for gma500 is different from the rest, as it uses stolen
      framebuffer memory that is not available via PCI BAR. The regular PCI
      removal helper cannot detect the framebuffer, while the non-PCI helper
      misses possible conflicting VGA devices (i.e., a framebuffer or text
      console).
      
      Gma500 therefore calls both helpers to catch all cases. It's confusing
      as it implies that there's something about the PCI device that requires
      ownership management. The relationship between the PCI device and the
      VGA devices is non-obvious. At worst, readers might assume that calling
      two functions for clearing aperture ownership is a bug in the driver.
      
      Hence, move the PCI removal helper's code for VGA functionality into
      a separate function and call this function from gma500. Documents the
      purpose of each call to aperture helpers. The change contains comments
      and example code form the discussion at [1].
      
      v5:
      	* fix grammar in gma500 comment (Javier)
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.kernel.org/project/dri-devel/patch/20230404201842.567344-1-daniel.vetter@ffwll.ch/ # 1
      Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-10-tzimmermann@suse.de
      116b1c5a
    • Daniel Vetter's avatar
      fbdev: Simplify fb_is_primary_device for x86 · 5ca1479c
      Daniel Vetter authored
      vga_default_device really is supposed to cover all corners, at least
      for x86. Additionally checking for rom shadowing should be redundant,
      because the bios/fw only does that for the boot vga device.
      
      If this turns out to be wrong, then most likely that's a special case
      which should be added to the vgaarb code, not replicated all over.
      
      Patch motived by changes to the aperture helpers, which also have this
      open code in a bunch of places, and which are all removed in a
      clean-up series. This function here is just for selecting the default
      fbdev device for fbcon, but I figured for consistency it might be good
      to throw this patch in on top.
      
      Note that the shadow rom check predates vgaarb, which was only wired
      up in commit 88674088 ("x86: Use vga_default_device() when
      determining whether an fb is primary"). That patch doesn't explain why
      we still fall back to the shadow rom check.
      
      v4:
      - fix commit message style (i.e., commit 1234 ("..."))
      - fix Daniel's S-o-b address
      
      v5:
      - add back an S-o-b tag with Daniel's Intel address
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Javier Martinez Canillas <javierm@redhat.com>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: x86@kernel.org
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-9-tzimmermann@suse.de
      5ca1479c
    • Daniel Vetter's avatar
      video/aperture: Only remove sysfb on the default vga pci device · 5ae3716c
      Daniel Vetter authored
      Instead of calling aperture_remove_conflicting_devices() to remove the
      conflicting devices, just call to aperture_detach_devices() to detach
      the device that matches the same PCI BAR / aperture range. Since the
      former is just a wrapper of the latter plus a sysfb_disable() call,
      and now that's done in this function but only for the primary devices.
      
      This fixes a regression introduced by commit ee7a69aa ("fbdev:
      Disable sysfb device registration when removing conflicting FBs"),
      where we remove the sysfb when loading a driver for an unrelated pci
      device, resulting in the user losing their efifb console or similar.
      
      Note that in practice this only is a problem with the nvidia blob,
      because that's the only gpu driver people might install which does not
      come with an fbdev driver of it's own. For everyone else the real gpu
      driver will restore a working console.
      
      Also note that in the referenced bug there's confusion that this same
      bug also happens on amdgpu. But that was just another amdgpu specific
      regression, which just happened to happen at roughly the same time and
      with the same user-observable symptoms. That bug is fixed now, see
      https://bugzilla.kernel.org/show_bug.cgi?id=216331#c15
      
      Note that we should not have any such issues on non-pci multi-gpu
      issues, because I could only find two such cases:
      - SoC with some external panel over spi or similar. These panel
        drivers do not use drm_aperture_remove_conflicting_framebuffers(),
        so no problem.
      - vga+mga, which is a direct console driver and entirely bypasses all
        this.
      
      For the above reasons the cc: stable is just notionally, this patch
      will need a backport and that's up to nvidia if they care enough.
      
      v2:
      - Explain a bit better why other multi-gpu that aren't pci shouldn't
        have any issues with making all this fully pci specific.
      
      v3
      - polish commit message (Javier)
      
      v4:
      - Fix commit message style (i.e., commit 1234 ("..."))
      - fix Daniel's S-o-b address
      
      v5:
      - add back an S-o-b tag with Daniel's Intel address
      
      Fixes: ee7a69aa ("fbdev: Disable sysfb device registration when removing conflicting FBs")
      Tested-by: default avatarAaron Plattner <aplattner@nvidia.com>
      Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216303#c28Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Cc: Aaron Plattner <aplattner@nvidia.com>
      Cc: Javier Martinez Canillas <javierm@redhat.com>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: <stable@vger.kernel.org> # v5.19+ (if someone else does the backport)
      Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-8-tzimmermann@suse.de
      5ae3716c