Commit graph

29135 commits

Author SHA1 Message Date
Jamie Lentin
d1c151dcae drm/udl: Ensure channel is selected before using the device.
Lift configuration command from udlfb. This appears to be essential for
at least a Rextron VCUD-60, without which no URB communication occurs.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471904254-26545-1-git-send-email-jm@lentin.co.uk
2016-08-23 09:29:59 +02:00
Chris Wilson
b4ba97e767 drm: Avoid calling dev_printk(.dev = NULL)
Since dev_printk likes to print "(NULL device *):" when passed in a NULL
pointer, we have to manually call printk() ourselves.

Fixes: c4e68a5832 ("drm: Introduce DRM_DEV_* log messages")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160819073750.16610-1-chris@chris-wilson.co.uk
2016-08-22 12:05:06 -04:00
Heinrich Schuchardt
ec913f31a5 drm: avoid exposing kernel stack in compat_drm_getstats
The C standard does not specify the size of the integer used
to store an enum. Hence in structure drm_stats32_t alignment
bytes may exist.

To avoid exposing bytes from the kernel stack it is
necessary to initialize variable s32 completely.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471802179-2886-1-git-send-email-xypron.glpk@gmx.de
2016-08-22 09:27:06 +02:00
Laurent Pinchart
420382adf6 drm: Don't implement empty prepare_fb()/cleanup_fb()
The plane .prepare_fb() and .cleanup_fb() helpers are optional, there's
no need to implement empty stubs, and no need to explicitly set the
function pointers to NULL either.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[danvet: Resolved conflicts with Chris' patch.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-19 10:58:55 +02:00
Markus Elfring
7ad61e6b4a virtio-gpu: Use memdup_user() rather than duplicating its implementation
Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/401e68fc-5515-7a7a-be2e-503dee676b34@users.sourceforge.net
2016-08-19 10:58:55 +02:00
Markus Elfring
a6e3918bcd GPU-DRM-Savage: Use memdup_user() rather than duplicating
Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/021efa32-c259-e799-a80e-630972291815@users.sourceforge.net
2016-08-19 10:58:55 +02:00
Chris Wilson
1832040d01 drm: Allow drivers to modify plane_state in prepare_fb/cleanup_fb
The drivers have to modify the atomic plane state during the prepare_fb
callback so they track allocations, reservations and dependencies for
this atomic operation involving this fb. In particular, how else do we
set the plane->fence from the framebuffer!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160818180017.20508-1-chris@chris-wilson.co.uk
2016-08-19 10:58:55 +02:00
Sean Paul
ee4d7899f6 drm/rockchip: Use DRM_DEV_ERROR in vop
Since we can have multiple vops, use DRM_DEV_ERROR to
make logs easier to process.

Acked-by: Mark Yao <mark.yao@rockchip.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1471021254-2563-3-git-send-email-seanpaul@chromium.org
2016-08-18 09:37:10 -07:00
Sean Paul
c4e68a5832 drm: Introduce DRM_DEV_* log messages
This patch consolidates all the various log functions/macros into
one uber function, drm_log. It also introduces some new DRM_DEV_*
variants that print the device name to delineate multiple devices
of the same type.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1471303084-3757-1-git-send-email-seanpaul@chromium.org
2016-08-18 09:37:10 -07:00
Clint Taylor
8f0e4907a8 drm/edid: CEA mode 64 1080p100 vsync pulse width incorrect
In the CEA-861 specification VIC 64 specifies a vsync pulse of 5 and
a backporch of 36. Adjust vsync pulse width to match specification.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1471282288-30909-1-git-send-email-clinton.a.taylor@intel.com
2016-08-18 09:37:10 -07:00
Daniel Vetter
9cd2e854d6 Revert "drm/hisilicon: Don't set drm_device->platformdev"
This reverts commit d25bcfb8c2.

I somehow missed that it only compiles on arm64 and broke the driver
rather badly.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-08-17 13:59:40 +02:00
Daniel Vetter
5ee4c8f064 drm: Fix kerneldoc in drm_plane_helper.c
Ville ocd'ed the parameter name, but forgot to update the docs!

Fixes: df86af9133 ("drm/plane-helper: Add drm_plane_helper_check_state()")
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-21-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:50:04 +02:00
Daniel Vetter
b3c6c8bfe3 drm: document drm_display_info
We seem to have a bit a mess in how to describe the bus formats, with
a multitude of competing ways. Might be best to consolidate it all and
use MEDIA_BUS_FMT_ also for the hdmi color formats and high color
modes.

Also move all the display_info related functions into drm_connector.c
(there's only one) to group it all together. I did decided against
also moving the edid related display info functions, they seem to fit
better in drm_edid.c. Instead sprinkle a few cross references around.
While at that reduce the kerneldoc for static functions, there's not
point in documenting internals with that much detail really.

v2: Fix typo and move misplaced hunk (Sean).

Cc: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-19-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:49:47 +02:00
Daniel Vetter
4644453747 drm: Remove display_info->min/max_(h|v)max
No one looks at it, only i915/gma500 lvds even bother to fill it
out. I guess a very old plan was to use this for filtering modes,
but that's already done within the edid parser.

v2: Move misplaced hunk to this patch.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-18-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:49:41 +02:00
Daniel Vetter
ae2a6da876 drm: Update connector documentation
- Shuffle docs from drm-kms.rst into the structure docs where it makes
  sense.
- Put the remaining bits into a new overview section.

One thing I've changed is around probing: Old docs says that you
_must_ use the probe helpers, which isn't correct. Helpers are always
optional.

v2: Review from Sean.

Cc: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-17-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:49:33 +02:00
Daniel Vetter
e15c8f4b6e drm: Don't export dp-aux devnode functions
They're only used internally within the dp helpers. Also nuke the
kerneldoc (we only document the driver interface in the drm shared
functions). And move the header file from the public include/
directory to the source files into drm_crtc_helper_internal.h, similar
to how we already have drm_crtc_internal.h.

While at it also move drm_fb_helper_modinit since that belongs in
there, too.

I noticed this all since I spotted kerneldoc which wasn't pulled into
the rst templates.

v2: Update Copyright date.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-16-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:49:26 +02:00
Daniel Vetter
52a9fcdac3 drm/doc: Include new drm_blend.c
There's not much point in kerneldoc if it's not included:
- It won't show up in the pretty html pages.
- The comments itself won't get parsed, which means 0day won't pick up
  changes, resulting in stale docs fast.

Also, uapi really should be core, not helpers, so move drm_blend.c to
that. That also means that the zpos normilize function loses it's
helper status (and we might as well call it always). For that,
EXPORT_SYMBOL. Just spotted while integrating docs and noticing that
one was missing.

With sphinx there's really no excuse any more to not build the docs
and make sure it's all nice!

$ make DOCBOOKS="" htmldocs

Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-15-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:49:20 +02:00
Daniel Vetter
5221719517 drm: Extract drm_connector.[hc]
Pulls in quite a lot of connector related structures (cmdline mode,
force/status enums, display info), but I think that all makes perfect
sense.

Also had to move a few more core kms object stuff into drm_modeset.h.

And as a first cleanup remove the kerneldoc for the 2 connector IOCTL
- DRM core docs are aimed at drivers, no point documenting internal in
excruciating detail.

v2: And also pull in all the connector property code.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-14-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:48:46 +02:00
Daniel Vetter
adebd6fe9f drm: Export drm_property_replace_global_blob
It's really part of the core blob interface, and the drm_connector.c
extraction needs it too.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-13-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 18:48:35 +02:00
Lothar Waßmann
cb34d7f2dc drm: update kerneldoc for changes introduced by commits "16fadc2568e9" and "9671e228fb78"
Describe the new parameter 'bus_flags' to of_get_drm_display_mode() in
the kerneldoc comments and add kerneldoc comments to the new function
drm_bus_flags_from_videomode().

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471354477-25877-1-git-send-email-LW@KARO-electronics.de
2016-08-16 17:32:08 +02:00
Daniel Vetter
750fb8c439 drm/doc: Update drm_framebuffer docs
- Move the intro section into a DOC comment, and update it slightly.
- kernel-doc for struct drm_framebuffer!

v2:
- Copypaste fail (Sean).
- Explain the linear @offsets clearer (Ville).

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-12-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 17:11:19 +02:00
Daniel Vetter
7520a277d9 drm: Extract drm_framebuffer.[hc]
Also start with drm_modeset.h with the core bits, since we need
to untangle this mess somehow. That allows us to move the drm_modes.h
include to the right spot, except for the temporary connector status
enum. That will get fixed as soon as drm_connector.h exists.

v2: Rebase.

v3: Move drm_crtc_force_disable_all back again, that wasn't meant to
be moved (Sean).

v4: Rebase.

Cc: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-16 16:49:03 +02:00
Daniel Vetter
6ab10b76ff drm/kms: Nuke dirty_info property
It was added way back together with the dirty_fb ioctl, but neither
generic xfree86-modesetting nor the vmware driver use it. Everyone is
supposed to just unconditionally call the dirtyfb when they do
frontbuffer rendering.

And since unused uabi is bad uabi (there's reasons we require open
source userspace for everything) let's nuke this.

For reference see

commit 884840aa3c
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Thu Dec 3 23:25:47 2009 +0000

    drm: Add dirty ioctl and property

Cc: Jakob Bornecrantz <jakob@vmware.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-9-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 16:30:50 +02:00
Daniel Vetter
d25bcfb8c2 drm/hisilicon: Don't set drm_device->platformdev
It's deprecated and only should be used by drivers which still use
drm_platform_init, not by anyone else.

And indeed it's entirely unused and can be nuked.

This required a bit more fudging, but I guess kirin_dc_ops really
wants to operate on the platform_device, not something else. Also
bonus points for implementing abstraction, and then storing the vfunc
in a global variable.

Cc: Xinliang Liu <xinliang.liu@linaro.org>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Archit Taneja <architt@codeaurora.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-7-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 16:30:49 +02:00
Daniel Vetter
f1d1326c99 drm/etnaviv: Don't set drm_device->platformdev
It's deprecated and only should be used by drivers which still use
drm_platform_init, not by anyone else.

And indeed it's entirely unused and can be nuked.

Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-6-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 16:10:43 +02:00
Daniel Vetter
1de72faf10 drm/kms-helpers: Extract drm_modeset_helper.[hc]
While reviewing docs I spotted that we have a few functions that
really just don't fit into their containing helper library section.
Extract them and shovel them all into a new library for random one-off
aux stuff.

v2: Remove wrongly added files for real.

Cc: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-3-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 16:10:19 +02:00
Daniel Vetter
62cacc7939 drm/doc: Fix more kerneldoc/sphinx warnings
These are the leftovers I could only track down using keep_warnings =
True. For some of them we might want to update our style guide on how
to reference structures and constants, not sure ...

Cc: Markus Heiser <markus.heiser@darmarit.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-1-git-send-email-daniel.vetter@ffwll.ch
2016-08-16 16:09:58 +02:00
Shawn Guo
e1f96ef46c drm: drop DRIVER_HAVE_IRQ flag for some drivers
Since commit 4984979b9b ("drm/irq: simplify irq checks in
drm_wait_vblank"), the drm driver feature flag DRIVER_HAVE_IRQ is only
required for drivers that have an IRQ handler managed by the DRM core.
Some drivers, armada, etnaviv, kirin and sti, set this flag without
.irq_handler setup in drm_driver.  These drivers manage IRQ handler
by themselves and the flag DRIVER_HAVE_IRQ makes no sense there.

Drop the flag for these drivers to avoid confusion.

Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk> (for armada and etnaviv)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471331168-5601-1-git-send-email-shawnguo@kernel.org
2016-08-16 14:07:43 +02:00
Eric Engestrom
d382814707 drm: remove const attribute to hint at caller that they now own the memory
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-16 14:06:53 +02:00
Wei Yongjun
b0f566838c drm/mgag200: fix error return code in mgag200fb_create()
Fix to return error code -ENOMEM from the vmalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: aec9e12953 ("drm/mgag200: Fix error handling paths in fbdev driver")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471273431-6753-1-git-send-email-weiyj.lk@gmail.com
2016-08-16 09:10:16 +02:00
Eric Engestrom
90844f0004 drm: make drm_get_format_name thread-safe
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
[danvet: Clarify that the returned pointer must be freed with
kfree().]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-15 09:25:12 +02:00
Dave Airlie
fc93ff608b Merge tag 'drm-intel-next-2016-08-08' of git://anongit.freedesktop.org/drm-intel into drm-next
- refactor ddi buffer programming a bit (Ville)
- large-scale renaming to untangle naming in the gem code (Chris)
- rework vma/active tracking for accurately reaping idle mappings of shared
  objects (Chris)
- misc dp sst/mst probing corner case fixes (Ville)
- tons of cleanup&tunings all around in gem
- lockless (rcu-protected) request lookup, plus use it everywhere for
  non(b)locking waits (Chris)
- pipe crc debugfs fixes (Rodrigo)
- random fixes all over

* tag 'drm-intel-next-2016-08-08' of git://anongit.freedesktop.org/drm-intel: (222 commits)
  drm/i915: Update DRIVER_DATE to 20160808
  drm/i915: fix aliasing_ppgtt leak
  drm/i915: Update comment before i915_spin_request
  drm/i915: Use drm official vblank_no_hw_counter callback.
  drm/i915: Fix copy_to_user usage for pipe_crc
  Revert "drm/i915: Track active streams also for DP SST"
  drm/i915: fix WaInsertDummyPushConstPs
  drm/i915: Assert that the request hasn't been retired
  drm/i915: Repack fence tiling mode and stride into a single integer
  drm/i915: Document and reject invalid tiling modes
  drm/i915: Remove locking for get_tiling
  drm/i915: Remove pinned check from madvise ioctl
  drm/i915: Reduce locking inside swfinish ioctl
  drm/i915: Remove (struct_mutex) locking for busy-ioctl
  drm/i915: Remove (struct_mutex) locking for wait-ioctl
  drm/i915: Do a nonblocking wait first in pread/pwrite
  drm/i915: Remove unused no-shrinker-steal
  drm/i915: Tidy generation of the GTT mmap offset
  drm/i915/shrinker: Wait before acquiring struct_mutex under oom
  drm/i915: Simplify do_idling() (Ironlake vt-d w/a)
  ...
2016-08-15 16:53:57 +10:00
Dave Airlie
f8725ad1da Merge tag 'topic/drm-misc-2016-08-12' of git://anongit.freedesktop.org/drm-intel into drm-next
- more fence destaging and cleanup (Gustavo&Sumit)
- DRIVER_LEGACY to untangle from DRIVER_MODESET
- drm_mm refactor (Chris)
- fbdev-less compile fies
- clipped plane src/dst rects (Ville)
- + a few mediatek patches that build on top of that (Bibby+Daniel)
- small stuff all over really

* tag 'topic/drm-misc-2016-08-12' of git://anongit.freedesktop.org/drm-intel: (43 commits)
  dma-buf/fence: kerneldoc: remove spurious section header
  dma-buf/fence: kerneldoc: remove unused struct members
  Revert "gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle"
  drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION
  drm/radeon|amgpu: Make fbdev emulation optional
  drm/vmwgfx: select CONFIG_FB
  drm: Remove superflous linux/fb.h includes
  drm/fb-helper: Add a dummy remove_conflicting_framebuffers
  dma-buf/sync_file: only enable fence signalling on poll()
  Documentation: add doc for sync_file_get_fence()
  dma-buf/sync_file: add sync_file_get_fence()
  dma-buf/sync_file: refactor fence storage in struct sync_file
  dma-buf/fence-array: add fence_is_array()
  drm/dp_helper: Rate limit timeout errors from drm_dp_i2c_do_msg()
  drm/dp_helper: Print first error received on failure in drm_dp_dpcd_access()
  drm: Add ratelimited versions of the DRM_DEBUG* macros
  drm: Make sure drm_vblank_no_hw_counter isn't abused
  drm/mediatek: Fix mtk_atomic_complete for runtime_pm
  drm/mediatek: plane: Use FB's format's cpp to compute x offset
  drm/mediatek: plane: Merge mtk_plane_enable into mtk_plane_atomic_update
  ...
2016-08-15 16:46:36 +10:00
Dave Airlie
a02b5a155e imx-drm updates and encoder atomic_mode_set helper callback
- add pixel clock and DE polarity configuration from device tree
   using display timing bindings for parallel and LVDS output
 - cleanup/remove trivial functions
 - cleanup and fixes in preparation for capture support
 - add atomic_mode_set helper and use it in imx-ldb - this is an
   alternative to the encoder mode_set callback that passes the
   crtc and connector state instead of just the mode. It allows
   drivers to get information from the attached connector without
   having to iterate over all connectors
 - add drm_bridge support to imx-ldb, for bridges attached via LVDS
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJXrXKYAAoJEFDCiBxwnmDrXocQAJVTaIbgwsq4G5CH3X3M3dRu
 vpIu71k2ww1YLktmE25AkIWKpMAdVQl+DwU3ARwqPtU6QRayolrYNgpmZAUzTy1a
 jk1CBYbhD+mi9uDaWo7HirGdClb0zs6tL1S56VnCA5AD36nix0ho6zkIutzxKFY6
 mFRFcIQPYbSykffyAaeyoVOqKUtQ4mdscMhIutrJABUX4U7PUhYWAWhv5PBvtLGa
 wfL/UA3aoDOK69M9z8ubdKhfKPKUCyU2BIgNdY3T5UunSEhLVAdHsp/1E1nguYQo
 x/ZzcO5+BZpNUeV3XStC4KTr5tl42TwTpXhmV9yVi+EGycRRp51U3GDyh7R3rRbO
 5R5c6iunwRth3R3vmRLLxU89sOfaq5m7qOkOerKtxAwvsAzCizLHyZIQdP1KMHsa
 fC3DmPIJZKdjI0Z5yED8mzEi25aT0rZiTMPwTmSyoKZ5SHH6udfHtraNTJwKsNIY
 Q4+9q21Q/tDV65xgzk/u9VFQl3S4ZuH54gdQ8s3UR0TWEmZyfSQ84qxTNu9Obeq5
 TqjwzJLktJ3yPKR6TEeiT/yRelmTobQGLbdwq+x0dcxfbgh/IE897my3OcsS3MjG
 X0kvNISSbtLZe2ShKX+sVTukQP+88IS84F5skGhkEpityUPkf4fyMo4x/tX/ygpN
 PceRsKJdoCEwoHGgN/jC
 =hj4e
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-next-2016-08-12' of git://git.pengutronix.de/git/pza/linux into drm-next

imx-drm updates and encoder atomic_mode_set helper callback

- add pixel clock and DE polarity configuration from device tree
  using display timing bindings for parallel and LVDS output
- cleanup/remove trivial functions
- cleanup and fixes in preparation for capture support
- add atomic_mode_set helper and use it in imx-ldb - this is an
  alternative to the encoder mode_set callback that passes the
  crtc and connector state instead of just the mode. It allows
  drivers to get information from the attached connector without
  having to iterate over all connectors
- add drm_bridge support to imx-ldb, for bridges attached via LVDS

* tag 'imx-drm-next-2016-08-12' of git://git.pengutronix.de/git/pza/linux:
  drm/imx-ldb: Add support to drm-bridge
  drm/imx: imx-ldb: use encoder atomic_mode_set callback
  drm/atomic-helper: Add atomic_mode_set helper callback
  drm/imx: Remove imx_drm_handle_vblank()
  gpu: ipu-v3: Add missing IDMAC channel names
  gpu: ipu-v3: rename CSI client device
  gpu: ipu-v3: Fix IRT usage
  gpu: ipu-v3: Fix CSI data format for 16-bit media bus formats
  gpu: ipu-v3: set correct full sensor frame for PAL/NTSC
  gpu: ipu-v3: Add VDI input IDMAC channels
  gpu: ipu-v3: Add ipu_get_num()
  gpu: ipu-cpmem: Add ipu_cpmem_get_burstsize()
  gpu: ipu-cpmem: Add ipu_cpmem_set_uv_offset()
  drm/imx: Remove imx_drm_crtc_id()
  drm/imx: Remove imx_drm_crtc_vblank_get/_put()
  drm/imx: convey the pixelclk-active and de-active flags from DT to the ipu-di driver
  drm: add a helper function to extract 'de-active' and 'pixelclk-active' from DT
2016-08-15 16:41:45 +10:00
Dave Airlie
c13eb9315f mediatek-drm maintainers and gamma correction
- add MAINTAINERS entry for mediatek-drm driver
 - add support for AAL and GAMMA engines
 - hook up gamma correction LUT
 - add support for temporal dithering to OD and GAMMA engines
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJXrXDqAAoJEFDCiBxwnmDrWFkP/RtEAKhOm5mzNksZb7FPv5Cd
 ngh/jN/9+q7JFoMstj/k9j0cUh3FOBQ2kh3AqKjH6R9PgZt9H9FGCgQWgVI7BNps
 yGZBSPogy3n+T9uZP0HTJRWXCnvaJbK5otNsmHmpdwHnXjUu6Li4aNDeg22MRiEI
 qQTE4UPm2Ry8FCRnQHYYXFMJFzYQQwWco5aq6Oja2YBvOunHuS/TcWQmW41kuPTc
 /V2XbF3Zx5RTfoOpBEvp5/tay3dKc2kE0FtggdzGBvJ4+b/Hx6c7ZvXH568C3nBw
 EqUC9+c3r/LA+KP3vALYF59gtt1ZzTsLB2sArGoo4UkNHNMjzqjjbANJDekezVhZ
 M8nbLgRWY/zF0u4/3xdr8t6VlPeUSUN85NW+8e2tN+CQu40crr/TRa7qB+JtNrLu
 09SjQ9qKkByvGA27jrQmjF5xtqrnxnB0XDh1GiAiesMGeHXCBeserCHS6tsKhgMX
 aa4uhuMW1TeBHNvfmjYJ4Vrl2OlqOk84mCyTFjsByMfJAOav8QGepasmbtE000PZ
 6IgtRn2E40Ml2zRBDOUm+B1EKLkJ5GGlwdkFTwBN15C7SDvobsdvKxN0KqLqbLhH
 mKBEepexdeNSYN7SpuXLXKyO+4JDaEW77qGy482D/0vUjvsogYhcCU6yvW53bOlQ
 QU7yz2Vm2oMdzhULwHrg
 =rl4u
 -----END PGP SIGNATURE-----

Merge tag 'mediatek-drm-next-2016-08-12' of git://git.pengutronix.de/git/pza/linux into drm-next

mediatek-drm maintainers and gamma correction

- add MAINTAINERS entry for mediatek-drm driver
- add support for AAL and GAMMA engines
- hook up gamma correction LUT
- add support for temporal dithering to OD and GAMMA engines

* tag 'mediatek-drm-next-2016-08-12' of git://git.pengutronix.de/git/pza/linux:
  drm/mediatek: set mt8173 dithering function
  drm/mediatek: Add gamma correction.
  drm/mediatek: Add GAMMA engine basic function
  drm/mediatek: Add AAL engine basic function
  drm: mediatek: add Maintainers entry for Mediatek DRM drivers
2016-08-15 16:41:17 +10:00
Dave Airlie
db4743227b Merge branch 'drm-next-tilcdc-atomic' of https://github.com/jsarha/linux into drm-next
Please pull tilcdc atomic modeset support and some non critical fixes.

* 'drm-next-tilcdc-atomic' of https://github.com/jsarha/linux: (29 commits)
  drm/tilcdc: Change tilcdc_crtc_page_flip() to tilcdc_crtc_update_fb()
  drm/tilcdc: Remove unnecessary pm_runtime_get() and *_put() calls
  drm/tilcdc: Get rid of legacy dpms mechanism
  drm/tilcdc: Use drm_atomic_helper_resume/suspend()
  drm/tilcdc: Enable and disable interrupts in crtc start() and stop()
  drm/tilcdc: tfp410: Add atomic modeset helpers to connector funcs
  drm/tilcdc: tfp410: Set crtc panel info at init phase
  drm/tilcdc: panel: Add atomic modeset helpers to connector funcs
  drm/tilcdc: panel: Set crtc panel info at init phase
  drm/tilcdc: Remove tilcdc_verify_fb()
  drm/tilcdc: Remove obsolete crtc helper functions
  drm/tilcdc: Set DRIVER_ATOMIC and use atomic crtc helpers
  drm/tilcdc: Add drm_mode_config_reset() call to tilcdc_load()
  drm/tilcdc: Add atomic mode config funcs
  drm/tilcdc: Add tilcdc_crtc_atomic_check()
  drm/tilcdc: Add tilcdc_crtc_mode_set_nofb()
  drm/tilcdc: Initialize dummy primary plane from crtc init
  drm/tilcdc: Add dummy primary plane implementation
  drm/tilcdc: Make tilcdc_crtc_page_flip() work if crtc is not yet on
  drm/tilcdc: Make tilcdc_crtc_page_flip() public
  ...
2016-08-15 16:39:28 +10:00
Peter Chen
5a78ff7bf7 Revert "gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle"
This reverts
commit 2ab9f58791
Author: Peter Chen <peter.chen@nxp.com>
Date:   Fri Jul 15 11:17:03 2016 +0800
    gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle

The of_get_next_parent will drop refcount on the passed node, so the reverted
patch is wrong, thanks for Tomi Valkeinen points it.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1470908694-16362-1-git-send-email-peter.chen@nxp.com
2016-08-12 07:10:37 -04:00
Daniel Vetter
0c756134cf drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION
For reasons that entirely elude me fb.h exposes all the structures,
even when it is not enabled. Except for special stuff like fb_defio.

Which means all the drivers which haven't yet switched over to the
defio support in the helpers and still roll their own, will fail
to compile when fbdev emulation is disabled. Protect just those
bits, as a gnarly reminder that conversion to the core defio helpers
would be good.

Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-6-git-send-email-daniel.vetter@ffwll.ch
2016-08-12 10:42:00 +02:00
Daniel Vetter
9db7d2b20c drm/radeon|amgpu: Make fbdev emulation optional
Seems to at least compile fine, only change needed was to use
the fb_set_suspend helper.

Cc: alexander.deucher@amd.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-5-git-send-email-daniel.vetter@ffwll.ch
2016-08-12 10:41:53 +02:00
Daniel Vetter
183cd49f1d drm/vmwgfx: select CONFIG_FB
vmwgfx doesn't actually build without that.

It would be great if vmwgfx could switch over to the fbdev emulation
helpers, since those will take care of all this already. I guess one
reason to not do that was lack of defio support in the helpers, but
that's fixed now. If there's any other hold-up, we should figure out
what it is and whether it makes sense to address it.

Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-4-git-send-email-daniel.vetter@ffwll.ch
2016-08-12 10:41:46 +02:00
Daniel Vetter
b1116f645c drm: Remove superflous linux/fb.h includes
Everyone who uses the fbdev emulation helpers doesn't need to include
fb.h directly. Remove it.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-3-git-send-email-daniel.vetter@ffwll.ch
2016-08-12 10:41:39 +02:00
Daniel Vetter
44adece57e drm/fb-helper: Add a dummy remove_conflicting_framebuffers
Lots of drivers don't properly compile without this when CONFIG_FB=n.
It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when
it's disabled I think it makes sense to add it to drm_fb_helper.h.

Long term we probably need to rethink all the logic to unload firmware
framebuffer drivers, at least if we want to be able to move away from
CONFIG_FB and fbcon.

v2: Unfortunately just stubbing out remove_conflicting_framebuffers in
drm_fb_helper.h upset gcc about static vs. non-static declarations, so
a new wrapper it needs to be. Means more churn :(

Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: tomi.valkeinen@ti.com
Cc: dh.herrmann@gmail.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch
2016-08-12 10:41:18 +02:00
Peter Senna Tschudin
dc80d70388 drm/imx-ldb: Add support to drm-bridge
Add support to attach a drm_bridge to imx-ldb in addition to
existing support to attach a LVDS panel.

This patch does a simple code refactoring by moving code
from for_each_child_of_node iterator to a new function named
imx_ldb_panel_ddc(). This was necessary to allow the panel ddc
code to run only when the imx_ldb is not attached to a bridge.

Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Herring <robh@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11 11:34:22 +02:00
Bibby Hsieh
7216436420 drm/mediatek: set mt8173 dithering function
Some panels only accept bpc (bit per color) 6-bit.
But, the default bpc in mt8173 display data path is 8-bit.
If we didn't enable dithering function to convert bpc,
display cannot show the smooth grayscale image.

In mt8173, the dithering function in OD (OverDrive) and
GAMMA module, we have to config them with
connector->display_mode.bpc when CRTC initial.

1. Clear the default value at *_DITHER_5 and *_DITHER_7 register.
2. Calculate the LSB_ERR_SHIFT bits and ADD_LSHIFT bits two values.
i.e. Input bpc of OD is 10 bits, we assume the bpc of panel is 6-bit,
so, we need to set 4-bit to LSB_ERR_SHIFT and ADD_LSHIFT bits respectively.
3. Then, set the OD or GAMMA to dithering mode depends on path-1 or path-2.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11 10:52:23 +02:00
Bibby Hsieh
2f3f4dda74 drm/mediatek: Add gamma correction.
Add gamma set function to correct brightness values.
It applies arbitrary mapping curve to compensate the
incorrect transfer function of the panel.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11 10:52:22 +02:00
Bibby Hsieh
e0a5d33702 drm/mediatek: Add GAMMA engine basic function
In order to correct brightness values, we have
to support gamma funciton on MT8173. In MT8173,
we have two engines for supporting gamma function:
AAL and GAMMA. This patch add some GAMMA engine
basic function, include config, start and stop
function.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11 08:41:39 +02:00
Bibby Hsieh
0664d1392c drm/mediatek: Add AAL engine basic function
In order to correct brightness values, we have
to support gamma funciton on MT8173. In MT8173,
we have two engines for supporting gamma function:
AAL and GAMMA. This patch add some AAL engine
basic function, include config, start and stop
function.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11 08:41:39 +02:00
Lyude
9622c38f1c drm/dp_helper: Rate limit timeout errors from drm_dp_i2c_do_msg()
Timeouts can be errors, but timeouts are also usually normal behavior
and happen a lot. Since the kernel already lets us know when we're
suppressing messages due to rate limiting, rate limit timeout errors so
we don't make too much noise in the kernel log.

Signed-off-by: Lyude <cpaul@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470443443-27252-8-git-send-email-cpaul@redhat.com
2016-08-09 18:23:44 +02:00
Lyude
29f21e0491 drm/dp_helper: Print first error received on failure in drm_dp_dpcd_access()
Since we always retry in drm_dp_dpcd_access() regardless of the error,
we're going to make a lot of noise if the aux->transfer function prints
it's own errors (as is the case with radeon). If we can print the error
code here, this reduces the need for drivers to do this. So instead of
having to print "dp_aux_ch timed out" over 32 times we can just print
once.

Signed-off-by: Lyude <cpaul@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470443443-27252-2-git-send-email-cpaul@redhat.com
2016-08-09 18:23:44 +02:00
Boris Brezillon
36e9d08b58 drm/cirrus: Fix NULL pointer dereference when registering the fbdev
cirrus_modeset_init() is initializing/registering the emulated fbdev
and, since commit c61b93fe51 ("drm/atomic: Fix remaining places where
!funcs->best_encoder is valid"), DRM internals can access/test some of
the fields in mode_config->funcs as part of the fbdev registration
process.
Make sure dev->mode_config.funcs is properly set to avoid dereferencing
a NULL pointer.

Reported-by: Mike Marshall <hubcap@omnibond.com>
Reported-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: c61b93fe51 ("drm/atomic: Fix remaining places where !funcs->best_encoder is valid")
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-09 13:01:47 +10:00