Skip to content
  1. Mar 26, 2020
    • Daniel Vetter's avatar
      drm: Set final_kfree in drm_dev_alloc · 6f365e56
      Daniel Vetter authored
      I also did a full review of all callers, and only the xen driver
      forgot to call drm_dev_put in the failure path. Fix that up too.
      
      v2: I noticed that xen has a drm_driver.release hook, and uses
      drm_dev_alloc(). We need to remove the kfree from
      xen_drm_drv_release().
      
      bochs also has a release hook, but leaked the drm_device ever since
      
      commit 0a6659bd
      Author: Gerd Hoffmann <kraxel@redhat.com>
      Date:   Tue Dec 17 18:04:46 2013 +0100
      
          drm/bochs: new driver
      
      This patch here fixes that leak.
      
      Same for virtio, started leaking with
      
      commit b1df3a2b
      
      
      Author: Gerd Hoffmann <kraxel@redhat.com>
      Date:   Tue Feb 11 14:58:04 2020 +0100
      
          drm/virtio: add drm_driver.release callback.
      
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: default avatarOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
      Cc: xen-devel@lists.xenproject.org
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
      Cc: xen-devel@lists.xenproject.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-5-daniel.vetter@ffwll.ch
      6f365e56
    • Daniel Vetter's avatar
      drm: add managed resources tied to drm_device · c6603c74
      Daniel Vetter authored
      
      
      We have lots of these. And the cleanup code tends to be of dubious
      quality. The biggest wrong pattern is that developers use devm_, which
      ties the release action to the underlying struct device, whereas
      all the userspace visible stuff attached to a drm_device can long
      outlive that one (e.g. after a hotunplug while userspace has open
      files and mmap'ed buffers). Give people what they want, but with more
      correctness.
      
      Mostly copied from devres.c, with types adjusted to fit drm_device and
      a few simplifications - I didn't (yet) copy over everything. Since
      the types don't match code sharing looked like a hopeless endeavour.
      
      For now it's only super simplified, no groups, you can't remove
      actions (but kfree exists, we'll need that soon). Plus all specific to
      drm_device ofc, including the logging. Which I didn't bother to make
      compile-time optional, since none of the other drm logging is compile
      time optional either.
      
      One tricky bit here is the chicken&egg between allocating your
      drm_device structure and initiliazing it with drm_dev_init. For
      perfect onion unwinding we'd need to have the action to kfree the
      allocation registered before drm_dev_init registers any of its own
      release handlers. But drm_dev_init doesn't know where exactly the
      drm_device is emebedded into the overall structure, and by the time it
      returns it'll all be too late. And forcing drivers to be able clean up
      everything except the one kzalloc is silly.
      
      Work around this by having a very special final_kfree pointer. This
      also avoids troubles with the list head possibly disappearing from
      underneath us when we release all resources attached to the
      drm_device.
      
      v2: Do all the kerneldoc at the end, to avoid lots of fairly pointless
      shuffling while getting everything into shape.
      
      v3: Add static to add/del_dr (Neil)
      Move typo fix to the right patch (Neil)
      
      v4: Enforce contract for drmm_add_final_kfree:
      
      Use ksize() to check that the drm_device is indeed contained somewhere
      in the final kfree(). Because we need that or the entire managed
      release logic blows up in a pile of use-after-frees. Motivated by a
      discussion with Laurent.
      
      v5: Review from Laurent:
      - %zu instead of casting size_t
      - header guards
      - sorting of includes
      - guarding of data assignment if we didn't allocate it for a NULL
        pointer
      - delete spurious newline
      - cast void* data parameter correctly in ->release call, no idea how
        this even worked before
      
      v6: Review from Sam
      - Add the kerneldoc for the managed sub-struct back in, even if it
        doesn't show up in the generated html somehow.
      - Explain why __always_inline.
      - Fix bisectability around the final kfree() in drm_dev_relase(). This
        is just interim code which will disappear again.
      - Some whitespace polish.
      - Add debug output when drmm_add_action or drmm_kmalloc fail.
      
      v7: My bisectability fix wasn't up to par as noticed by smatch.
      
      v8: Remove unecessary {} around if else
      
      v9: Use kstrdup_const, which requires kfree_const and introducing a free_dr()
      helper (Thomas).
      
      v10: kfree_const goes boom on the plain "kmalloc" assignment, somehow
      we need to wrap that in kstrdup_const() too!! Also renumber revision
      log, I somehow reset it midway thruh.
      
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Neil Armstrong <narmstrong@baylibre.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>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200324124540.3227396-1-daniel.vetter@ffwll.ch
      c6603c74
    • Daniel Vetter's avatar
      drm/i915: Don't clear drvdata in ->release · 0ce542f7
      Daniel Vetter authored
      For two reasons:
      
      - The driver core clears this already for us after we're unloaded in
        __device_release_driver().
      
      - It's way too late, the drm_device ->release callback might massively
        outlive the underlying physical device, since a drm_device can be
        kept alive by open drm_file or well really anything else userspace
        is still hanging onto. So if we clear this ourselves, we should
        clear it in the pci ->remove callback, not in the drm_device
        ->release callback.
      
      Looking at git history this was fixed in the driver core with
      
      commit 0998d063
      
      
      Author: Hans de Goede <hdegoede@redhat.com>
      Date:   Wed May 23 00:09:34 2012 +0200
      
          device-core: Ensure drvdata = NULL when no driver is bound
      
      v2: Cite the core fix in the commit message (Chris).
      
      v3: Fix commit message and unused variable warning (Jani).
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-3-daniel.vetter@ffwll.ch
      0ce542f7
    • Daniel Vetter's avatar
      mm/sl[uo]b: export __kmalloc_track(_node)_caller · fd7cb575
      Daniel Vetter authored
      
      
      slab does this already, and I want to use this in a memory allocation
      tracker in drm for stuff that's tied to the lifetime of a drm_device,
      not the underlying struct device. Kinda like devres, but for drm.
      
      Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-mm@kvack.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-2-daniel.vetter@ffwll.ch
      fd7cb575
  2. Mar 25, 2020
  3. Mar 23, 2020
  4. Mar 22, 2020
  5. Mar 20, 2020
    • Tomi Valkeinen's avatar
      omapfb: Remove unused writeback code · 4f55bb03
      Tomi Valkeinen authored
      
      
      Remove unused writeback code. This code will never be used, as omapfb is
      being deprecated.
      
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200313122410.7528-1-tomi.valkeinen@ti.com
      4f55bb03
    • Randy Dunlap's avatar
      fbdev: via: fix -Wextra build warning and format warning · 6ce2fc42
      Randy Dunlap authored
      
      
      When 'VIAFB_DEBUG' and 'VIAFB_WARN' are not defined, modify the
      DEBUG_MSG() &WARN_MSG() macros to use the no_printk() macro instead of
      using <empty>.
      This fixes a build warning when -Wextra is used and provides
      printk format checking:
      
      ../drivers/video/fbdev/via/ioctl.c:88:47: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      
      Also use %lu to print an unsigned long instead of just %l, to fix
      a printk format warning:
      
      ../drivers/video/fbdev/via/viafbdev.c: In function ‘viafb_dvp0_proc_write’:
      ../drivers/video/fbdev/via/viafbdev.c:1148:14: warning: unknown conversion type character ‘]’ in format [-Wformat=]
          DEBUG_MSG("DVP0:reg_val[%l]=:%x\n", i,
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-7-rdunlap@infradead.org
      6ce2fc42
    • Randy Dunlap's avatar
      fbdev: pm[23]fb.c: fix -Wextra build warnings and errors · 1a56b9fa
      Randy Dunlap authored
      
      
      When 'DEBUG' is not defined, modify the DPRINTK() macro to use the
      no_printk() macro instead of using <empty>.
      This fixes build warnings when -Wextra is used and provides
      printk format checking:
      
      ../drivers/video/fbdev/pm2fb.c:227:38: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
      ../drivers/video/fbdev/pm3fb.c:1039:33: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      
      Also drop one argument in two DPRINTK() macro uses to provide the
      correct number of arguments and use the correct field in one case
      to fix a build error:
      
      ../drivers/video/fbdev/pm3fb.c:353:9: error: ‘struct fb_info’ has no member named ‘current_par’
           info->current_par->depth);
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-6-rdunlap@infradead.org
      1a56b9fa
    • Randy Dunlap's avatar
      fbdev: savage: fix -Wextra build warning · 5194480c
      Randy Dunlap authored
      
      
      When 'SAVAGEFB_DEBUG' is not defined, modify the DBG() macro to use the
      no_printk() macro instead of using <empty>.
      This fixes a build warning when -Wextra is used and provides
      printk format checking:
      
      ../drivers/video/fbdev/savage/savagefb_driver.c:2411:13: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-5-rdunlap@infradead.org
      5194480c
    • Randy Dunlap's avatar
      fbdev: matrox: fix -Wextra build warnings · 6ea16a0b
      Randy Dunlap authored
      
      
      When 'DEBUG' is not defined, modify the dprintk() macro to use the
      no_printk() macro instead of using <empty>.
      This fixes build warnings when -Wextra is used and provides
      printk format checking:
      
      ../drivers/video/fbdev/matrox/matroxfb_base.c:635:77: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
      ../drivers/video/fbdev/matrox/matroxfb_Ti3026.c:632:54: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      ../drivers/video/fbdev/matrox/matroxfb_Ti3026.c:654:53: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-4-rdunlap@infradead.org
      6ea16a0b
    • Randy Dunlap's avatar
      fbdev: aty: fix -Wextra build warning · c43da061
      Randy Dunlap authored
      
      
      When 'DEBUG' is not defined, modify the DPRINTK() macro to use the
      no_printk() macro instead of using <empty>.
      This fixes a build warning when -Wextra is used and provides
      printk format checking:
      
      ../drivers/video/fbdev/aty/atyfb_base.c:784:61: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-3-rdunlap@infradead.org
      c43da061
    • Randy Dunlap's avatar
      fbdev: fbmon: fix -Wextra build warnings · b5445b24
      Randy Dunlap authored
      
      
      When 'DEBUG' is not defined, modify the DPRINTK() macro to use the
      no_printk() macro instead of using <empty>.
      This fixes a build warning when -Wextra is used and provides
      printk format checking:
      
      ../drivers/video/fbdev/core/fbmon.c:812:47: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
      ../drivers/video/fbdev/core/fbmon.c:842:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      ../drivers/video/fbdev/core/fbmon.c:847:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-2-rdunlap@infradead.org
      b5445b24
    • Takashi Iwai's avatar
      video: uvesafb: Use scnprintf() for avoiding potential buffer overflow · 06b522d6
      Takashi Iwai authored
      
      
      Since snprintf() returns the would-be-output size instead of the
      actual output size, the succeeding calls may go beyond the given
      buffer limit.  Fix it by replacing with scnprintf().
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200311093230.24900-4-tiwai@suse.de
      06b522d6
    • Takashi Iwai's avatar
      video: omap2: Use scnprintf() for avoiding potential buffer overflow · 42f21e54
      Takashi Iwai authored
      
      
      Since snprintf() returns the would-be-output size instead of the
      actual output size, the succeeding calls may go beyond the given
      buffer limit.  Fix it by replacing with scnprintf().
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200311093230.24900-3-tiwai@suse.de
      42f21e54
    • Takashi Iwai's avatar
      video: omapfb: Use scnprintf() for avoiding potential buffer overflow · bf1b615a
      Takashi Iwai authored
      
      
      Since snprintf() returns the would-be-output size instead of the
      actual output size, the succeeding calls may go beyond the given
      buffer limit.  Fix it by replacing with scnprintf().
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200311093230.24900-2-tiwai@suse.de
      bf1b615a
  6. Mar 19, 2020
    • Jiri Slaby's avatar
      drm/virtio: fix OOB in virtio_gpu_object_create · 0666a8d7
      Jiri Slaby authored
      After commit f651c8b0
      
       ("drm/virtio: factor out the sg_table from
      virtio_gpu_object"), virtio_gpu_create_object allocates too small space
      to fit everything in. It is because it allocates struct
      virtio_gpu_object, but should allocate a newly added struct
      virtio_gpu_object_shmem which has 2 more members.
      
      So fix that by using correct type in virtio_gpu_create_object.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Link: http://patchwork.freedesktop.org/patch/msgid/20200319100421.16267-1-jslaby@suse.cz
      Fixes: f651c8b0
      
       ("drm/virtio: factor out the sg_table from virtio_gpu_object")
      Cc: Gurchetan Singh <gurchetansingh@chromium.org>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      0666a8d7
    • Ville Syrjälä's avatar
      drm: Skip drm_mode_config_validate() for !modeset · b684822a
      Ville Syrjälä authored
      drm_mode_config_init() may not have been called when the driver/device
      doesn't support modeset. That will cause drm_mode_config_validate()
      to oops. Skip the validation for !modeset.
      
      TODO: We may want to consider calling drm_mode_config_init()
      unconditionally to avoid similar issues elsewhere...
      
      Fixes: 74d2aacb
      
       ("drm: Validate encoder->possible_clones")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200318182518.31618-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      b684822a
    • Daniel Vetter's avatar
      MAINTAINERS: Better regex for dma_buf|fence|resv · 8edb6997
      Daniel Vetter authored
      
      
      We're getting some random other stuff that we're not really interested
      in, so match only word boundaries. Also avoid the capture group while
      at it.
      
      Suggested by Joe Perches.
      
      Acked-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Cc: linux-media@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linaro-mm-sig@lists.linaro.org
      Cc: Joe Perches <joe@perches.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200317205643.1028398-1-daniel.vetter@ffwll.ch
      8edb6997
    • Wambui Karuga's avatar
      drm: convert .debugfs_init() hook to return void. · 7ce84471
      Wambui Karuga authored
      As a result of commit 987d65d0
      
       (drm: debugfs: make
      drm_debugfs_create_files() never fail) and changes to various debugfs
      functions in drm/core and across various drivers, there is no need for
      the drm_driver.debugfs_init() hook to have a return value. Therefore,
      declare it as void.
      
      This also includes refactoring all users of the .debugfs_init() hook to
      return void across the subsystem.
      
      v2: include changes to the hook and drivers that use it in one patch to
      prevent driver breakage and enable individual successful compilation of
      this change.
      
      References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html
      Signed-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-18-wambui.karugax@gmail.com
      7ce84471
    • Ville Syrjälä's avatar
      drm: Validate encoder->possible_crtcs · 0df10823
      Ville Syrjälä authored
      
      
      WARN if the encoder possible_crtcs is effectively empty or contains
      bits for non-existing crtcs.
      
      v2: Move to drm_mode_config_validate() (Daniel)
          Make the docs say we WARN when this is wrong (Daniel)
          Extract full_crtc_mask()
      
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-7-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      0df10823
    • Ville Syrjälä's avatar
      drm: Validate encoder->possible_clones · 74d2aacb
      Ville Syrjälä authored
      
      
      Many drivers are populating encoder->possible_clones wrong. Let's
      persuade them to get it right by adding some loud WARNs.
      
      We'll cross check the bits between any two encoders. So either
      both encoders can clone with the other, or neither can.
      
      We'll also complain about effectively empty possible_clones, and
      possible_clones containing bits for encoders that don't exist.
      
      v2: encoder->possible_clones now includes the encoder itelf
      v3: Move to drm_mode_config_validate() (Daniel)
          Document that you get a WARN when this is wrong (Daniel)
          Extract full_encoder_mask()
      v4: !! instead of ! (Daniel)
      
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-6-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      74d2aacb
    • Ville Syrjälä's avatar
      drm/imx: Remove the bogus possible_clones setup · 9cb6a976
      Ville Syrjälä authored
      
      
      It's not at all clear what cloning options this driver supports.
      So let's just clear possible_clones instead of setting it to some
      bogus value.
      
      v2: Adjust the FIXME (Daniel)
      
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-5-ville.syrjala@linux.intel.com
      9cb6a976
    • Ville Syrjälä's avatar
      drm/gma500: Sanitize possible_clones · 8a7827ee
      Ville Syrjälä authored
      
      
      I doubt the DP+DP and SDVO+SDVO cloning works for this driver.
      i915 at least doesn't do those. Truthfully there could be some very
      specific circumstances where some of them would do doable, but
      genereally it's too much pain to deal with so we've chose not to
      bother. Let's use the same approach for gma500.
      
      Also the LVDS+LVDS and DSI+DSI cases probably don't really exist as
      there is one of each at most.
      
      This does mean we'll now leave possible_clones at 0 for these encoder
      types whereas previosuly we included the encoder itself in the bitmask.
      But that's fine as the core now treaks 0 as a special case and adds
      the encoder itself into the final bitmask reported to userspace.
      
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-3-ville.syrjala@linux.intel.com
      8a7827ee
    • Ville Syrjälä's avatar
      drm: Include the encoder itself in possible_clones · 71427795
      Ville Syrjälä authored
      
      
      The docs say possible_clones should always include the encoder itself.
      Since most drivers don't want to deal with the complexities of cloning
      let's allow them to set possible_clones=0 and instead we'll fix that
      up in the core.
      
      We can't put this special case into drm_encoder_init() because drivers
      will have to fill up possible_clones after adding all the relevant
      encoders. Otherwise they wouldn't know the proper encoder indexes to
      use. So we'll just do it just before registering the device.
      
      v2: Don't set the bit if possible_clones!=0 so that the
          validation (coming soon) will WARN (Thomas)
          Fix up the docs to allow possible_clones==0 (Daniel)
          .late_register() is too late, introduce drm_mode_config_validate()
          which gets called _before_ we register the char device (Daniel)
      
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-2-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      71427795
    • Wambui Karuga's avatar
      drm/debugfs: remove checks for return value of drm_debugfs functions. · a212d6a5
      Wambui Karuga authored
      Since 987d65d0
      
       (drm: debugfs: make drm_debugfs_create_files() never
      fail), there is no need to check the return value of
      drm_debugfs_create_files(). Therefore, remove remove unnecessary checks
      and error handling statement blocks for its return value.
      
      These changes also enable changing drm_debugfs_create_files() to return
      void.
      
      Signed-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-17-wambui.karugax@gmail.com
      a212d6a5