Skip to content
Snippets Groups Projects
  1. Jul 20, 2023
  2. Jun 26, 2023
  3. Jun 19, 2023
  4. May 24, 2023
  5. Mar 22, 2023
  6. Feb 10, 2023
  7. Jan 13, 2023
  8. Nov 22, 2022
    • Oded Gabbay's avatar
      accel: add dedicated minor for accelerator devices · 2c204f3d
      Oded Gabbay authored
      
      The accelerator devices are exposed to user-space using a dedicated
      major. In addition, they are represented in /dev with new, dedicated
      device char names: /dev/accel/accel*. This is done to make sure any
      user-space software that tries to open a graphic card won't open
      the accelerator device by mistake.
      
      The above implies that the minor numbering should be separated from
      the rest of the DRM devices. However, to avoid code duplication, we
      want the drm_minor structure to be able to represent the accelerator
      device.
      
      To achieve this, we add a new drm_minor* to drm_device that represents
      the accelerator device. This pointer is initialized for drivers that
      declare they handle compute accelerator, using a new driver feature
      flag called DRIVER_COMPUTE_ACCEL. It is important to note that this
      driver feature is mutually exclusive with DRIVER_RENDER. Devices that
      want to expose both graphics and compute device char files should be
      handled by two drivers that are connected using the auxiliary bus
      framework.
      
      In addition, we define a different IDR to handle the accelerators
      minors. This is done to make the minor's index be identical to the
      device index in /dev/. Any access to the IDR is done solely
      by functions in accel_drv.c, as the IDR is define as static. The
      DRM core functions call those functions in case they detect the minor's
      type is DRM_MINOR_ACCEL.
      
      We define a separate accel_open function (from drm_open) that the
      accel drivers should set as their open callback function. Both these
      functions eventually call the same drm_open_helper(), which had to be
      changed to be non-static so it can be called from accel_drv.c.
      accel_open() only partially duplicates drm_open as I removed some code
      from it that handles legacy devices.
      
      To help new drivers, I defined DEFINE_DRM_ACCEL_FOPS macro to easily
      set the required function operations pointers structure.
      
      Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarJeffrey Hugo <quic_jhugo@quicinc.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
      Tested-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
      Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
      2c204f3d
  9. Nov 16, 2022
  10. Dec 02, 2021
  11. Nov 27, 2021
  12. Nov 11, 2021
  13. Aug 10, 2021
  14. Mar 26, 2021
  15. Jan 05, 2021
  16. Nov 06, 2020
  17. Sep 25, 2020
  18. Sep 21, 2020
  19. Sep 03, 2020
  20. Jun 15, 2020
  21. Jun 10, 2020
  22. May 19, 2020
  23. Apr 28, 2020
  24. Mar 26, 2020
    • Simona Vetter's avatar
      drm: Add docs for managed resources · 9e1ed9fb
      Simona Vetter authored
      
      All collected together to provide a consistent story in one patch,
      instead of the somewhat bumpy refactor-evolution leading to this.
      
      Also some thoughts on what the next steps could be:
      
      - Create a macro called devm_drm_dev_alloc() which essentially wraps
        the kzalloc(); devm_drm_dev_init(); drmm_add_final_kfree() combo.
        Needs to be a macro since we'll have to do some typeof trickery and
        casting to make this fully generic for all drivers that embed struct
        drm_device into their own thing.
      
      - A lot of the simple drivers now have essentially just
        drm_dev_unplug(); drm_atomic_helper_shutdown(); as their
        $bus_driver->remove hook. We could create a devm_mode_config_reset
        which sets drm_atomic_helper_shutdown as it's cleanup action, and a
        devm_drm_dev_register with drm_dev_unplug as it's cleanup action,
        and simple drivers wouldn't have a need for a ->remove function at
        all, and we could delete them.
      
      - For more complicated drivers we need drmm_ versions of a _lot_ more
        things. All the userspace visible objects (crtc, plane, encoder,
        crtc), anything else hanging of those (maybe a drmm_get_edid, at
        least for panels and other built-in stuff).
      
      Also some more thoughts on why we're not reusing devm_ with maybe a
      fake struct device embedded into the drm_device (we can't use the
      kdev, since that's in each drm_minor).
      
      - Code review gets extremely tricky, since every time you see a devm_
        you need to carefully check whether the fake device (with the
        drm_device lifetim) or the real device (with the lifetim of the
        underlying physical device and driver binding) are used. That's not
        going to help at all, and we have enormous amounts of drivers who
        use devm_ where they really shouldn't. Having different types makes
        sure the compiler type checks this for us and ensures correctness.
      
      - The set of functions are very much non-overlapping. E.g.
        devm_ioremap makes total sense, drmm_ioremap has the wrong lifetime,
        since hw resources need to be cleaned out at driver unbind and wont
        outlive that like a drm_device. Similar, but other way round for
        drmm_connector_init (which is the only correct version, devm_ for
        drm_connector is just buggy). Simply not having the wrong version
        again prevents bugs.
      
      Finally I guess this opens a huge todo for all the drivers. I'm
      semi-tempted to do a tree-wide s/devm_kzalloc/drmm_kzalloc/ since most
      likely that'll fix an enormous amount of bugs and most likely not
      cause any issues at all (aside from maybe holding onto memory slightly
      too long).
      
      v2:
      - Doc improvements from Laurent.
      - Also add kerneldoc for the new drmm_add_action_or_reset.
      
      v3:
      - Remove kerneldoc for drmm_remove_action.
      
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-doc@vger.kernel.org
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      
      fixup docs
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-52-daniel.vetter@ffwll.ch
      9e1ed9fb
    • Simona Vetter's avatar
      drm: Garbage collect drm_dev_fini · d33b58d0
      Simona Vetter authored
      
      It has become empty. Given the few users I figured not much point
      splitting this up.
      
      v2: Rebase over i915 changes.
      
      v3: Rebase over patch split fix.
      
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-26-daniel.vetter@ffwll.ch
      d33b58d0
  25. Mar 18, 2020
  26. Feb 13, 2020
  27. Jan 29, 2020
  28. Jan 25, 2020
  29. Oct 02, 2019
  30. Jul 31, 2019
  31. Jun 21, 2019
    • Simona Vetter's avatar
      drm/prime: Align gem_prime_export with obj_funcs.export · e4fa8457
      Simona Vetter authored
      
      The idea is that gem_prime_export is deprecated in favor of
      obj_funcs.export. That's much easier to do if both have matching
      function signatures.
      
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: "Michel Dänzer" <michel.daenzer@amd.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: Felix Kuehling <Felix.Kuehling@amd.com>
      Cc: Hawking Zhang <Hawking.Zhang@amd.com>
      Cc: Feifei Xu <Feifei.Xu@amd.com>
      Cc: Jim Qu <Jim.Qu@amd.com>
      Cc: Evan Quan <evan.quan@amd.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Thomas Zimmermann <tdz@users.sourceforge.net>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Jilayne Lovejoy <opensource@jilayne.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Junwei Zhang <Jerry.Zhang@amd.com>
      Cc: intel-gvt-dev@lists.freedesktop.org
      Cc: intel-gfx@lists.freedesktop.org
      Cc: amd-gfx@lists.freedesktop.org
      Cc: linux-tegra@vger.kernel.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-10-daniel.vetter@ffwll.ch
      e4fa8457
    • Simona Vetter's avatar
      drm/prime: Actually remove DRIVER_PRIME everywhere · 0424fdaf
      Simona Vetter authored
      
      Split out to make the functional changes stick out more.
      
      All places where DRIVER_PRIME was used have been removed in previous
      patches already.
      
      v2: amdgpu gained DRIVER_SYNCOBJ_TIMELINE.
      
      v3: amdgpu lost DRIVER_SYNCOBJ_TIMELINE.
      
      v4: Don't add a space in i915_drv.c (Sam)
      
      v5: Add note that previous patches removed all the DRIVER_PRIME users
      already (Emil).
      
      v6: Fixupe ingenic (new driver) while applying.
      
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: etnaviv@lists.freedesktop.org
      Cc: freedreno@lists.freedesktop.org
      Cc: intel-gfx@lists.freedesktop.org
      Cc: lima@lists.freedesktop.org
      Cc: linux-amlogic@lists.infradead.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-arm-msm@vger.kernel.org
      Cc: linux-aspeed@lists.ozlabs.org
      Cc: linux-renesas-soc@vger.kernel.org
      Cc: linux-rockchip@lists.infradead.org
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      Cc: linux-tegra@vger.kernel.org
      Cc: nouveau@lists.freedesktop.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: spice-devel@lists.freedesktop.org
      Cc: virtualization@lists.linux-foundation.org
      Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
      Cc: xen-devel@lists.xenproject.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20190617153924.414-1-daniel.vetter@ffwll.ch
      0424fdaf
    • Simona Vetter's avatar
      drm/prime: Update docs · 805dc614
      Simona Vetter authored
      
      Yes this is a bit a big patch, but since it's essentially a complete
      rewrite of all the prime docs I didn't see how to better split it up.
      
      Changes:
      - Consistently point to drm_gem_object_funcs as the preferred hooks,
        where applicable.
      
      - Document all the hooks in &drm_driver that lacked kerneldoc.
      
      - Completely new overview section, which now also includes the cleaned
        up lifetime/reference counting subchapter. I also mentioned the weak
        references in there due to the lookup caches.
      
      - Completely rewritten helper intro section, highlight the
        import/export related functionality.
      
      - Polish for all the functions and more cross references.
      
      I also sprinkled a bunch of todos all over.
      
      Most important: 0 code changes in here. The cleanup motivated by
      reading and improving all this will follow later on.
      
      v2: Actually update the prime helper docs. Plus add a few FIXMEs that
      I won't address right away in subsequent cleanup patches.
      
      v3:
      - Split out the function moving. This patch is now exclusively
        documentation changes.
      - Typos and nits (Sam).
      
      v4: Polish suggestions from Noralf.
      
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarEmil Velikov <emil.velikov@collabora.com>
      Acked-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Noralf Trønnes <noralf@tronnes.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Emil Velikov <emil.l.velikov@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190620124615.24434-1-daniel.vetter@ffwll.ch
      805dc614
  32. May 02, 2019
  33. Mar 25, 2019
Loading