aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-09-12drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=mMaxime Ripard1-3/+11
Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module: ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined! ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined! ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined! This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules. Fixes: cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") Fixes: 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON") Reviewed-by: Daniel Vetter <[email protected]> Tested-by: Jon Hunter <[email protected]> Tested-by: Matt Hart <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12qxl: refactor to use drm_fb_helper_fbdev_setupPeter Wu4-276/+60
Lots of code can be removed by relying on fb-helper: - "struct drm_framebuffer" moves to fb_helper.fb. - "struct drm_gem_object" moves to fb_helper.obj[0]. - "struct qxl_device" can be inferred as drm_fb_helper is embedded. - qxl_user_framebuffer_create -> drm_gem_fb_create. - qxl_user_framebuffer_destroy -> drm_gem_fb_destroy. - qxl_fbdev_destroy -> drm_fb_helper_fbdev_teardown + vfree(shadow). Remove unused code: - qxl_fbdev_qobj_is_fb, qxl_fbdev_set_suspend. - Unused fields of qxl_fbdev: delayed_ops, delayed_ops_lock, size. Misc notes: - The dirty callback is preserved as it is necessary to trigger update commands in the hw (the screen stays black otherwise). - No idea when .create_handle in drm_framebuffer_funcs is used, but use the same drm_gem_fb_create_handle to match drm_gem_fb_funcs. - I don't know why qxl_fb_find_or_create_single used to check for an existing framebuffer and removed that check to match other drivers. - Use of drm_fb_helper_fbdev_teardown also requires "info->fbdefio" to be dynamically allocated. Replace the existing defio config by drm_fb_helper_defio_init to accomodate this. Testing results: startx with fbdev, modesetting and qxl all seems to work. Tested also with CONFIG_DRM_FBDEV_EMULATION=n, fbdev obviously fails but others are fine. QEMU -spice and QEMU -spice with vdagent and multiple (resized) displays (via remote-viewer) also works. unbind vtconsole and rmmod has *not* regressed (i.e. it still trips on a use-after-free in qxl_check_idle via qxl_ttm_fini). Ideally setup/teardown is replaced by drm_fbdev_generic_setup as that would result in further code reduction, improve error handling (like not leaking shadow memory), but unfortunately QXL has no implementation for qxl_gem_prime_vmap. Signed-off-by: Peter Wu <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2018-09-12udmabuf: use sizeof(variable) instead of sizeof(type)Gerd Hoffmann1-3/+3
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: drop WARN_ON() check.Gerd Hoffmann1-3/+0
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: use ENOTTY for invalid ioctlsGerd Hoffmann1-1/+1
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: use EBADFD in case we didn't got a memfdGerd Hoffmann1-2/+5
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: improve udmabuf_create error handlingGerd Hoffmann1-13/+12
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: rework limitsGerd Hoffmann1-2/+8
Create variable for the list length limit. Serves as documentation, also allows to make it a module parameter if needed. Also add a total size limit. Signed-off-by: Gerd Hoffmann <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: add MEMFD_CREATE dependencyGerd Hoffmann1-0/+1
udmabuf builds without it, but if userspace can not create memfd handles in the first place it is rather pointless to include it, except for test builds. Signed-off-by: Gerd Hoffmann <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: constify udmabuf_create argsGerd Hoffmann1-2/+2
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: constify udmabuf_opsGerd Hoffmann1-1/+1
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: use pgoff_t for pagecountGerd Hoffmann1-1/+1
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: improve map_udmabuf error handlingGerd Hoffmann1-11/+10
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-12udmabuf: sort headers, drop uapi/ path prefixGerd Hoffmann1-9/+8
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-11drm/vkms: Add kerneldoc entryHaneen Mohammed4-0/+41
Add an initial kerneldoc entry for vkms with a todo list. Signed-off-by: Haneen Mohammed <[email protected]> [danvet: Keep the todo.rst entry to point at the vkms docs instead.] Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20180907174136.GA2648@haneenDRM
2018-09-11drm/vkms: Enable/Disable cursor support with module optionHaneen Mohammed3-5/+14
Cursor support is not complete yet. Add module option 'enable_cursor' to enable/disable cursor support which is used for testing currently. Signed-off-by: Haneen Mohammed <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/b47f44f518d3c9858f1469193f1136e0c490060b.1536210181.git.hamohammed.sa@gmail.com
2018-09-11drm/vkms: Compute CRC with Cursor PlaneHaneen Mohammed3-26/+143
This patch compute CRC for output frame with cursor and primary plane. Blend cursor with primary plane and compute CRC on the resulted frame. This currently passes cursor-size-change, and cursor-64x64-[onscreen, offscreen, sliding, random, dpms, rapid-movement] from igt kms_cursor_crc tests. Signed-off-by: Haneen Mohammed <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/b1749f5c90da5721a481f12740e2e370edb4a752.1536210181.git.hamohammed.sa@gmail.com
2018-09-11drm/vkms: Add cursor plane supportHaneen Mohammed3-16/+44
Add cursor plane support and update vkms_plane_atomic_check to enable positioning cursor plane. Signed-off-by: Haneen Mohammed <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/c69078820eacf3246fa77beb0c6227b692cc5e82.1536210181.git.hamohammed.sa@gmail.com
2018-09-11drm/fb: Stop leaking physical addressDaniel Vetter1-0/+2
For buffer sharing, use dma-buf instead. We can't set smem_start to 0 unconditionally since that's used by the fbdev mmap default implementation. And we have plenty of userspace which would like to keep that working. This might break legit userspace - if it does we need to look at a case-by-cases basis how to handle that. Worst case I expect overrides for only specific drivers, since anything remotely modern should be using dma-buf/prime now (which is about 7 years old now for DRM drivers). This issue was uncovered because Noralf's rework to implement a generic fb_probe also implements it's own fb_mmap callback. Which means smem_start didn't have to be set anymore, which blew up some blob in userspace rather badly. Acked-by: Sean Paul <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Cc: John Stultz <[email protected]> Cc: Noralf Trønnes <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-11fbdev: Add FBINFO_HIDE_SMEM_START flagDaniel Vetter2-0/+11
DRM drivers really, really, really don't want random userspace to share buffer behind it's back, bypassing the dma-buf buffer sharing machanism. For that reason we've ruthlessly rejected any IOCTL exposing the physical address of any graphics buffer. Unfortunately fbdev comes with that built-in. We could just set smem_start to 0, but that means we'd have to hand-roll our own fb_mmap implementation. For good reasons many drivers do that, but smem_start/length is still super convenient. Hence instead just stop the leak in the ioctl, to keep fb mmap working as-is. A second patch will set this flag for all drm drivers. Acked-by: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Kees Cook <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-11vt: Remove vc_panic_force_writeDaniel Vetter4-18/+5
It was only used by the panic support in fbcon, which is now gone. Remove this now dead code too. Acked-by: Greg Kroah-Hartman <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Kees Cook <[email protected]> Cc: Joe Perches <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Meng Xu <[email protected]> Cc: Nicolas Pitre <[email protected]> Cc: Thomas Meyer <[email protected]> Cc: Mike Frysinger <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Thierry Reding <[email protected]> Cc: David Lechner <[email protected]> Cc: Philippe Ombredanne <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-11fbdev: Drop FBINFO_CAN_FORCE_OUTPUT flagDaniel Vetter4-8/+1
This was only added for the drm's fbdev emulation support, so that it would try harder to show the Oops. Unfortunately this never really worked reliably, and in practice ended up pushing the real Oops off the screen due to plentyfull locking, sleep-while-atomic and other issues. So we removed all that support from the fbdev emulation a while back. Aside: We've also removed the kgdb support, for similar reasons. Since it's such a small patch I figured I don't split this up into the usual 3-phase removal. Acked-by: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Alexander Kapshuk <[email protected]> Cc: Kees Cook <[email protected]> Cc: Thierry Reding <[email protected]> Cc: David Lechner <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-11drm: Clarify DRM_MODE_REFLECT_X/Y documentationAlexandru Gheorghe2-1/+24
DRM_MODE_REFLECT_X and DRM_MODE_REFLECT_Y meaning seems a bit unclear to me, so try to clarify that with a bit of ascii graphics. Changes since v1: - Move the ascii graphics in the kerneldoc where all plane properties are already documented and make sure it's properly rendered, suggestested by Daniel Vetter. Signed-off-by: Alexandru Gheorghe <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-11drm: Remove set but not used variable 'config'YueHaibing1-2/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/drm_plane.c: In function 'drm_mode_getplane_res': drivers/gpu/drm/drm_plane.c:475:26: warning: variable 'config' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-10drm/rockchip: Allow driver to be shutdown on reboot/kexecMarc Zyngier1-0/+6
Leaving the DRM driver enabled on reboot or kexec has the annoying effect of leaving the display generating transactions whilst the IOMMU has been shut down. In turn, the IOMMU driver (which shares its interrupt line with the VOP) starts warning either on shutdown or when entering the secondary kernel in the kexec case (nothing is expected on that front). A cheap way of ensuring that things are nicely shut down is to register a shutdown callback in the platform driver. Signed-off-by: Marc Zyngier <[email protected]> Tested-by: Vicente Bergas <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Cc: [email protected]
2018-09-10drm/fb-helper: improve documentation and print warningsPeter Wu1-6/+18
Clarify the relation between drm_fb_helper_fbdev_setup/teardown. Clarify requirements for the new generic fbdev emulation API and log some more details in case the driver does something wrong. Fix related typos. Cc: Noralf Trønnes <[email protected]> Signed-off-by: Peter Wu <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2018-09-10bochs: convert to drm_dev_registerPeter Wu3-8/+30
The drm_get_pci_dev API is deprecated, replace it by drm_dev_register. Signed-off-by: Peter Wu <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2018-09-10bochs: convert to drm_fb_helper_fbdev_setup/teardownPeter Wu4-157/+22
Currently unloading bochs_drm (after unbinding the vtconsole) results in a warning about a leaked connector: [drm:drm_mode_config_cleanup] *ERROR* connector Virtual-3 leaked! While investigating a potential fix I noticed that a lot of open-coded functionality is already implemented elsewhere, so start converting it: bochs_fbdev_init -> drm_fb_helper_fbdev_setup: trivial (similar impl). bochs_fbdev_fini -> drm_fb_helper_fbdev_teardown: requires unembedding "struct drm_framebuffer" from "struct bochs_framebuffer". Unembedding drm_framebuffer is made easy using drm_gem_fbdev_fb_create which can replace bochs_fbdev_destroy and custom routines in bochs_mm.c. For this to work, the GEM object is moved into "drm_framebuffer". After that, "bochs_framebuffer" is no longer needed and therefore removed. Remove the unused "size" and "initialized" fields from fb, the latter is not necessary as drm_fb_helper_fbdev_teardown can be called even if bochsfb_create fails. This theory was tested by returning early and late (just before drm_gem_fbdev_fb_create). Both scenarios fail gracefully although the latter seems to leak the object from bochsfb_create_object (not a regression). Guess on the reason for the encoder leak: drm_framebuffer_cleanup was previously used, but did not destroy much. drm_fb_helper_fbdev_teardown is now used and calls drm_framebuffer_remove which does a bit more work. Tested with 'echo 0 > /sys/class/vtconsole/vtcon1/bind; rmmod bochs_drm' and also with Xorg + fbdev (startx -> xterm). The latter triggered a warning in ttm_bo_vm_open that existed before, see https://lkml.kernel.org/r/[email protected] Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Peter Wu <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2018-09-10bochs: use drm_fb_helper_set_suspend_unlocked in suspend/resumePeter Wu1-10/+2
The "initialized" member is going away. suspend/resume still works (even if bochsfb_create is forced to fail). Signed-off-by: Peter Wu <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2018-09-10drm: refuse ADDFB2 ioctl for broken bigendian driversGerd Hoffmann3-3/+29
Drivers must set the quirk_addfb_prefer_host_byte_order quirk to make the drm_mode_addfb() compat code work correctly on bigendian machines. If they don't they interpret pixel_format values incorrectly for bug compatibility, which in turn implies the ADDFB2 ioctl does not work correctly then. So block it to make userspace fallback to ADDFB. Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-10drm/virtio: Remove set but not used variable 'bo'YueHaibing1-3/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/virtio/virtgpu_display.c: In function 'virtio_gpu_framebuffer_init': drivers/gpu/drm/virtio/virtgpu_display.c:78:28: warning: variable 'bo' set but not used [-Wunused-but-set-variable] struct virtio_gpu_object *bo; ^ Signed-off-by: YueHaibing <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2018-09-09drm: extract drm_atomic_uapi.cDaniel Vetter18-1375/+1483
This leaves all the commit/check and state handling in drm_atomic.c, while pulling all the uapi glue and the huge ioctl itself into a seprate file. This seems to almost perfectly split the rather big drm_atomic.c file into 2 equal sizes. Also adjust the kerneldoc and type a very terse overview text. v2: Rebase. v3: Fix tiny typo. v4: - Fixup armada, newly converted atomic driver hooray! - Fixup msm/dpu1, newly added too. Signed-off-by: Daniel Vetter <[email protected]> Cc: David Airlie <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Sean Paul <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Rob Clark <[email protected]> Cc: Eric Anholt <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-09drm: Update todo.rstDaniel Vetter1-58/+10
- drmP.h is now fully split up. - vkms is happening (and will gain its own todo and docs under a new vkms.rst file real soon) - legacy cruft is completely hidden now, drm_vblank.c is split out from drm_irq.c now. I've decided to drop the task to split out drm_legacy.ko, partially because Dave already rejected a patch to hide the old dri1 drivers better. Current state feels good enough to me. - best_encoder atomic cleanup is done (it's now the default, not even exported anymore) - bunch of smaller things v2: - Explain why the drm_legacy.ko task is dropped (Emil). - typos (Sam). v3: Fix typo (Ilia) Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Cc: Ilia Mirkin <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Emil Velikov <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-09drm/atomic: trim driver interface/docsDaniel Vetter3-194/+34
Remove the kerneldoc and EXPORT_SYMBOL which aren't used and really shouldn't ever be used by drivers directly. Unfortunately this means we need to move the set_writeback_fb function around to avoid a forward decl. Acked-by: Heiko Stuebner <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: David Airlie <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-09drm: drop drmP.h include from drm_crtc.cDaniel Vetter1-1/+4
This is starting to become easy! v2: Compiles now, with drm/drm_util.h extracted. v3: Fix up commit message (Sam Ravnborg) Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-09drm: drop drmP.h include from drm_plane.cDaniel Vetter5-1/+23
Just a bit of missing includes and pre declarations. v2: Compiles now, with drm/drm_util.h extracted. v3: Rebase v3: Fix up commit message (Sam Ravnborg) Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-09drm: Drop drmP.h from drm_connector.cDaniel Vetter2-1/+10
Only needed minimal changes in drm_internal.h (for the drm_ioctl_t type and a few forward declarations), plus a few missing includes in drm_connector.c. Yay, the last stage of the drm header cleanup can finally commence! v2: Compiles now, with drm/drm_util.h extracted. v3: Fix up commit message (Sam Ravnborg) Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-09drm: Add drm/drm_util.h header fileDaniel Vetter11-3/+44
We have a bunch of neat little macros all over the place which should move to kernel.h. But some of them died in bikesheds on lkml, and we need a decent home for them. Start out by moving the for_each_if macro there. v2: Rename to drm_util.h instead (Dave&Sean) Cc: Sean Paul <[email protected]> Acked-by: Sean Paul <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Dave Airlie <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-07drm/fb-helper: document remove*_conflicting_framebuffers()Michał Mirosław1-0/+22
Copy remove*_conflicting_framebuffers() kerneldocs from fbdev code to make DRM developers' life easier. Signed-off-by: Michał Mirosław <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/f70c1cc4a4f77dd9bad58fc7ca344609c0a91fa7.1536342228.git.mirq-linux@rere.qmqm.pl
2018-09-07fbdev: fix kerneldocMichał Mirosław1-2/+2
As noticed by kbuild test robot <[email protected]>, remove_conflicting_pci_framebuffers()'s second argument is called res_id not resource_id. Fix this. Signed-off-by: Michał Mirosław <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/38ca9044455a33e398b45e0281643cc24da3c2fc.1536342224.git.mirq-linux@rere.qmqm.pl
2018-09-07drm/sun4i: tcon: Add dithering support for RGB565/RGB666 LCD panelsJonathan Liu1-0/+61
The hardware supports dithering on TCON channel 0 which is used for LCD panels. Dithering is a method of approximating a color from a mixture of other colors when the required color isn't available. It reduces color banding artifacts that can be observed when displaying gradients (e.g. grayscale gradients). This may occur when the image that needs to be displayed is 24-bit but the LCD panel is a lower bit depth and does not perform dithering on its own. Signed-off-by: Jonathan Liu <[email protected]> [[email protected]: check display_info.bpc first; handle LVDS and MIPI DSI] Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-07drm/sun4i: tcon: Rename Dithering related register macrosChen-Yu Tsai1-12/+15
Dithering is only supported for TCON channel 0. Throughout the datasheet all the names associated with these register are prefixed "TCON0", instead of "TCON". The only exception is the control register "TCON_FRM_CTL_REG". Rename the macros to reflect this. Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-07drm/sun4i: tcon: Pass drm_encoder * into sun4i_tcon0_mode_set_cpuChen-Yu Tsai1-9/+6
sun4i_tcon0_mode_set_cpu() currently accepts struct mipi_dsi_device * as its second parameter. This is derived from drm_encoder. The DSI encoder is tied to the CPU interface mode of the TCON as a special case. In theory, if hardware were available, we could also support normal CPU interface modes. It is better to pass the generic encoder instead of the specialized mipi_dsi_device, and handle the differences inside the function. Passing the encoder would also enable the function to pass it, or any other data structures related to it, to other functions expecting it. One such example would be dithering support that will be added in a later patch, which looks at properties tied to the connector to determine whether dithering should be enabled or not. Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-06drm: expand replace_fence to support timeline point v2Chunming Zhou6-11/+13
we can place a fence to a timeline point after expanded. v2: change func parameter order Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/246543/
2018-09-06drm: expand drm_syncobj_find_fence to support timeline point v2Chunming Zhou5-7/+8
we can fetch timeline point fence after expanded. v2: The parameter fence is the result of the function and should come last. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/246541/
2018-09-06drm: rename null fence to stub fence in syncobj v2Chunming Zhou1-24/+29
moved to front of file. stub fence will be used by timeline syncobj as well. Signed-off-by: Chunming Zhou <[email protected]> Cc: Jason Ekstrand <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/246539/
2018-09-06drm: fix syncobj null_fence_enable_signalingChunming Zhou1-1/+0
That is certainly totally nonsense. dma_fence_enable_sw_signaling() is the function who is calling this callback. Signed-off-by: Chunming Zhou <[email protected]> Cc: Jason Ekstrand <[email protected]> Reviewed-by: Christian König <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/246535/
2018-09-06drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctlChris Wilson3-11/+36
Since this is handling user provided bpp and depth, we need to sanity check and propagate the EINVAL back rather than assume what the insane client intended and fill the logs with DRM_ERROR. v2: Check both bpp and depth match the builtin pixel format, and introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future fourcc. v3: Mark up DRM_FORMAT_C8 as being {bpp:8, depth:8} Testcase: igt/kms_addfb_basic/legacy-format Signed-off-by: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Michel Dänzer <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-06drm: fix drm_mode_addfb() on big endian machines.Gerd Hoffmann2-0/+25
Userspace on big endian machhines typically expects the ADDFB ioctl returns a big endian framebuffer. drm_mode_addfb() will call drm_mode_addfb2() unconditionally with little endian DRM_FORMAT_* values though, which is wrong. This patch fixes that. Drivers (both kernel and xorg) have quirks in place to deal with the broken drm_mode_addfb() behavior. Because of this we can't just change drm_mode_addfb() behavior for everybody without breaking things. Add the quirk_addfb_prefer_host_byte_order field to mode_config, so drivers can opt-in. Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-06drm: do not mask out DRM_FORMAT_BIG_ENDIANGerd Hoffmann1-1/+1
framebuffer_check() expects that drm_get_format_info() will not fail if the __drm_format_info() call was successful. That'll work only in case both are called with the same pixel_format value, so masking out the DRM_FORMAT_BIG_ENDIAN flag isn't a good idea. Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]