linux-2.6-microblaze.git
8 years agoMerge branch 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux into drm...
Dave Airlie [Tue, 8 Mar 2016 00:51:14 +0000 (10:51 +1000)]
Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux into drm-next

Notable changes:
- correctness fixes to the GPU cache flushing when switching execution
state and when powering down the GPU
- reduction of time spent in hardirq-off context
- placement improvements to the GPU DMA linear window, allowing the
driver to properly work on i.MX6 systems with more than 2GB of RAM

* 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux:
  drm: etnaviv: clean up submit_bo()
  drm: etnaviv: clean up vram_mapping submission/retire path
  drm: etnaviv: improve readability of command insertion to ring buffer
  drm: etnaviv: clean up GPU command submission
  drm: etnaviv: use previous GPU pipe state when pipe switching
  drm: etnaviv: flush all GPU caches when stopping GPU
  drm: etnaviv: track current execution state
  drm: etnaviv: extract arming of semaphore
  drm: etnaviv: extract replacement of WAIT command
  drm: etnaviv: extract command ring reservation
  drm/etnaviv: move GPU linear window to end of DMA window
  drm/etnaviv: move runtime PM balance into retire worker

8 years agoMerge tag 'drm-intel-next-2016-02-29' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Tue, 8 Mar 2016 00:50:37 +0000 (10:50 +1000)]
Merge tag 'drm-intel-next-2016-02-29' of git://anongit.freedesktop.org/drm-intel into drm-next

- fbc by default on hsw&bdw, thanks to great work by Paulo!
- psr by default hsw,bdw,vlv&chv, thanks to great work by Rodrigo!
- fixes to hw state readout vs. rpm issues (Imre)
- dc3 fixes&improvements (Mika), this and above already cherr-pick to -fixes
- first part of locking fixes from Tvrtko
- proper atomic code for load detect (Maarten)
- more rpm fixes from Ville
- more atomic work from Maarten

* tag 'drm-intel-next-2016-02-29' of git://anongit.freedesktop.org/drm-intel: (63 commits)
  drm/i915: Update DRIVER_DATE to 20160229
  drm/i915: Execlists cannot pin a context without the object
  drm/i915: Reduce the pointer dance of i915_is_ggtt()
  drm/i915: Rename vma->*_list to *_link for consistency
  drm/i915: Balance assert_rpm_wakelock_held() for !IS_ENABLED(CONFIG_PM)
  drm/i915/lrc: Only set RS ctx enable in ctx control reg if there is a RS
  drm/i915/gen9: Set value of Indirect Context Offset based on gen version
  drm/i915: Remove update_sprite_watermarks.
  drm/i915: Kill off intel_crtc->atomic.wait_vblank, v6.
  drm/i915: Unify power domain handling.
  drm/i915: Pass crtc state to modeset_get_crtc_power_domains.
  drm/i915: Add for_each_pipe_masked()
  drm/i915: Make sure pipe interrupts are processed before turning off power well on BDW+
  drm/i915: synchronize_irq() before turning off disp2d power well on VLV/CHV
  drm/i915: Skip PIPESTAT reads from irq handler on VLV/CHV when power well is down
  drm/i915/gen9: Write dc state debugmask bits only once
  drm/i915/gen9: Extend dmc debug mask to include cores
  drm/i915/gen9: Verify and enforce dc6 state writes
  drm/i915/gen9: Check for DC state mismatch
  drm/i915/fbc: enable FBC by default on HSW and BDW
  ...

8 years agoMerge tag 'tilcdc-4.6' of https://github.com/jsarha/linux into drm-next
Dave Airlie [Tue, 8 Mar 2016 00:49:58 +0000 (10:49 +1000)]
Merge tag 'tilcdc-4.6' of https://github.com/jsarha/linux into drm-next

tilcdc changes for v4.6

Accumulated fixes and improvements from ti-linux-4.1.
* Almost complete rewrite of pagefliping code
* dma-buf support
* pinctrl support
* lot of fixes and cleanups

* tag 'tilcdc-4.6' of https://github.com/jsarha/linux: (22 commits)
  drm/tilcdc: Use devm_kzalloc() and devm_kcalloc() for private data
  drm/tilcdc: Initialize crtc->port
  drm/tilcdc: Disable sync lost interrupt if it fires on every frame
  drm/tilcdc: Add prints on sync lost and FIFO underrun interrupts
  drm/tilcdc: Remove the duplicate LCDC_INT_ENABLE_SET_REG in registers[]
  drm/tilcdc: Fix interrupt enable/disable code for version 2 tilcdc
  drm/tilcdc: Do not update the next frame buffer close to vertical blank
  drm/tilcdc: Get rid of complex ping-pong mechanism
  drm/tilcdc: cleanup irq handling
  drm/tilcdc: remove broken error handling
  drm/tilcdc: split reset to a separate function
  drm/tilcdc: disable crtc on unload
  drm/tilcdc: cleanup runtime PM handling
  drm/tilcdc: Allocate register storage based on the actual number registers
  drm/tilcdc: fix build error when !CONFIG_CPU_FREQ
  drm/tilcdc: Implement dma-buf support for tilcdc
  drm/tilcdc: disable the lcd controller/dma engine when suspend invoked
  drm/tilcdc: make frame_done interrupt active at all times
  drm/tilcdc: fix kernel panic on suspend when no hdmi monitor connected
  drm/tilcdc: adopt pinctrl support
  ...

8 years agodrm: etnaviv: clean up submit_bo()
Russell King [Thu, 21 Jan 2016 15:20:55 +0000 (15:20 +0000)]
drm: etnaviv: clean up submit_bo()

As we now store the etnaviv_vram_mapping, we no longer need to store
the iova itself: we can get this directly from the mapping structure.
Arrange for submit_bo() to return a pointer to etnaviv_gem_submit_bo,
and directly access mapping->iova when applying relocations.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: clean up vram_mapping submission/retire path
Russell King [Thu, 21 Jan 2016 15:20:50 +0000 (15:20 +0000)]
drm: etnaviv: clean up vram_mapping submission/retire path

Currently, we scan the list of mappings each time we want to operate on
the vram_mapping struct.  Rather than repeatedly scanning these, look
them up once in the submission path, and then use _reference and
_unreference methods as necessary to manage this object.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: improve readability of command insertion to ring buffer
Russell King [Thu, 21 Jan 2016 15:20:40 +0000 (15:20 +0000)]
drm: etnaviv: improve readability of command insertion to ring buffer

Improve the readibility of the function which inserts command buffers
and other maintanence commands into the GPUs ring buffer.  We do this
by splitting the ring buffer reservation in two: one chunk for any
commands that need to be issued prior to the command buffer, and a
separate chunk for commands issued after the buffer.

The result is a much more obvious code flow in this function, and
localisation of the conditional maintanence commands prior to the
command buffer.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: clean up GPU command submission
Russell King [Thu, 21 Jan 2016 15:20:35 +0000 (15:20 +0000)]
drm: etnaviv: clean up GPU command submission

Clean up the GPU command submission path to prepare for the next change.
This makes the next change easier to read and understand.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: use previous GPU pipe state when pipe switching
Russell King [Thu, 21 Jan 2016 15:20:30 +0000 (15:20 +0000)]
drm: etnaviv: use previous GPU pipe state when pipe switching

Use the previous GPU pipe state when deciding which GPU caches should
be flushed prior to switching the current pipe.  This avoids infering
what the previously selected pipe was, and potentially flushing the
wrong caches.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: flush all GPU caches when stopping GPU
Russell King [Thu, 21 Jan 2016 15:20:25 +0000 (15:20 +0000)]
drm: etnaviv: flush all GPU caches when stopping GPU

Flush the GPU caches to ensure that any dirty data is pushed out before
stopping the front end.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: track current execution state
Russell King [Thu, 21 Jan 2016 15:20:19 +0000 (15:20 +0000)]
drm: etnaviv: track current execution state

Add tracking of the current execution state (iow, active GPU pipe).

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: extract arming of semaphore
Russell King [Thu, 21 Jan 2016 15:20:14 +0000 (15:20 +0000)]
drm: etnaviv: extract arming of semaphore

Extract out the arming of a semaphore from the pipe select code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: extract replacement of WAIT command
Russell King [Thu, 21 Jan 2016 15:20:09 +0000 (15:20 +0000)]
drm: etnaviv: extract replacement of WAIT command

Extract out the replacement of the WAIT command with some other command.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm: etnaviv: extract command ring reservation
Russell King [Thu, 21 Jan 2016 15:20:04 +0000 (15:20 +0000)]
drm: etnaviv: extract command ring reservation

Provide a helper etnaviv_buffer_reserve() to ensure that we can fit a
set of commands into the ring buffer without wrapping by moving code
out of etnaviv_buffer_queue().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm/etnaviv: move GPU linear window to end of DMA window
Lucas Stach [Mon, 25 Jan 2016 16:03:09 +0000 (17:03 +0100)]
drm/etnaviv: move GPU linear window to end of DMA window

If the end of the system DMA window is farther away from the start of
physical RAM than the size of the GPU linear window, move the linear
window so that it ends at the same address than the system DMA window.

This allows to map command buffer from CMA, which is likely to reside
at the end of the system DMA window, while also overlapping as much
RAM as possible, in order to optimize regular buffer mappings through
the linear window.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agodrm/etnaviv: move runtime PM balance into retire worker
Lucas Stach [Thu, 7 Jan 2016 11:43:15 +0000 (12:43 +0100)]
drm/etnaviv: move runtime PM balance into retire worker

The retire worker is kicked for each fence, either the normal way
by signaling the fence from the event completion interrupt or by
the recover worker if the GPU got stuck. Moving the RPM put into
the retire worker allows us to have it in a single place for
both cases.

This also shaves off quite a bit of the CPU time spent in hardirq
context, as arming the autosuspend timer when the RPM refcount
drops to 0 is a relatively costly operation.

Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
8 years agoMerge tag 'omapdrm-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux...
Dave Airlie [Fri, 4 Mar 2016 22:07:58 +0000 (08:07 +1000)]
Merge tag 'omapdrm-4.6' of git://git./linux/kernel/git/tomba/linux into drm-next

omapdrm changes for v4.6

* HDMI interlace output support
* DMAbuf import support
* Big refactoring leading to removal of legacy code
* Various non-critical fixes

* tag 'omapdrm-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (76 commits)
  drm/omap: no need to select OMAP2_DSS
  drm/omap: gem: Fix omap_gem_new() error path
  drm/omap: remove -Werror from Makefile
  drm/omap: remove dispc_ovl_check()
  drm/omap: remove dss compat code
  drm/omap: remove last uses of omap_overlay_manager
  drm/omap: DSI: remove uses of omap_overlay_manager
  drm/omap: VENC: remove uses of omap_overlay_manager
  drm/omap: SDI: remove uses of omap_overlay_manager
  drm/omap: HDMI4: remove uses of omap_overlay_manager
  drm/omap: HDMI5: remove uses of omap_overlay_manager
  drm/omap: DPI: remove uses of omap_overlay_manager
  drm/omap: remove extra manager checks on disconnect
  drm/omap: remove extra check in dpi and sdi
  drm/omap: convert dss_mgr_unregister_framedone_handler to accept omap_channel
  drm/omap: convert dss_mgr_register_framedone_handler to accept omap_channel
  drm/omap: convert dss_mgr_start_update to accept omap_channel
  drm/omap: convert dss_mgr_disable to accept omap_channel
  drm/omap: convert dss_mgr_enable to accept omap_channel
  drm/omap: convert dss_mgr_set_lcd_config to accept omap_channel
  ...

8 years agoMerge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm...
Dave Airlie [Fri, 4 Mar 2016 03:37:39 +0000 (13:37 +1000)]
Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next

Big ticket items are hdmi support for 8996 (aka snapdragon 820), and
adreno 430 support.  Also one more small uapi addition to support
timestamp queries.

* 'msm-next' of git://people.freedesktop.org/~robclark/linux: (29 commits)
  drm/msm: rename hdmi symbols
  drm/msm/adreno: remove duplicate adreno_hw_init() call
  drm/msm: add timestamp param
  drm/msm: fix small typo
  drm/msm: grab struct_mutex after allocating submit
  drm/msm: reject submit ioctl if no gpu
  drm/msm/adreno: print details in case of a protect fault interrupt
  drm/msm/adreno: get CP_RPTR from register instead of shadow memory
  drm/msm/adreno: add adreno430 power control
  drm/msm/adreno: support for adreno 430.
  drm/msm: update generated headers
  drm/msm/dsi: fix definition of msm_dsi_pll_28nm_8960_init()
  drm/msm/dsi: Parse DSI lanes via DT
  drm/msm/dsi: Drop VDD regulator for MSM8916
  drm/msm/dsi: Remove incorrect warning on host attach
  drm/msm: Free fb helper resources in msm_unload
  drm/msm/mdp: Detach iommu in mdp4_destroy
  drm/msm: make iommu port names const'ier
  drm/msm/mdp: Use atomic helper to set crtc property
  dt-bindings: msm/hdmi: Add HDMI PHY bindings
  ...

8 years agodrm/msm: rename hdmi symbols
Arnd Bergmann [Mon, 22 Feb 2016 21:08:35 +0000 (22:08 +0100)]
drm/msm: rename hdmi symbols

Global symbols in the kernel should be prefixed by the name
of the subsystem and/or driver to avoid conflicts when all
code is built-in.

In this case, function names like 'hdmi_register' or 'hdmi_set_mode'
are way too generic for an MSM specific DRM driver, so I'm renaming
them all to msm_hdmi_* here.

I also rename a lot of the 'static' symbols along with the global
names for consistency, even though those are relatively harmless;
they might only be slightly confusing when they show up in
backtraces.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/adreno: remove duplicate adreno_hw_init() call
Rob Clark [Wed, 24 Feb 2016 23:56:24 +0000 (18:56 -0500)]
drm/msm/adreno: remove duplicate adreno_hw_init() call

Not sure where it came from, but seem unintentional.  And also not
needed on a420, so let's just drop it.

Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm: add timestamp param
Rob Clark [Mon, 22 Feb 2016 11:26:21 +0000 (06:26 -0500)]
drm/msm: add timestamp param

We need this for GL_TIMESTAMP queries.

Note: currently only supported on a4xx.. a3xx doesn't have this
always-on counter.  I think we could emulate it with the one CP
counter that is available, but for now it is of limited usefulness
on a3xx (since we can't seem to do time-elapsed queries in any sane
way with the existing firmware on a3xx, and if you are trying to do
profiling on a tiler you want time-elapsed).  We can add that later
if it becomes useful.

Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm: fix small typo
Rob Clark [Wed, 3 Feb 2016 19:02:04 +0000 (14:02 -0500)]
drm/msm: fix small typo

Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm: grab struct_mutex after allocating submit
Rob Clark [Wed, 3 Feb 2016 18:24:35 +0000 (13:24 -0500)]
drm/msm: grab struct_mutex after allocating submit

No real need to hold the lock over allocation, and simplifies things
slightly if we change the order.

Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm: reject submit ioctl if no gpu
Rob Clark [Wed, 3 Feb 2016 18:12:31 +0000 (13:12 -0500)]
drm/msm: reject submit ioctl if no gpu

Existing userspace wouldn't get this far, since getparam ioctl would
have failed and it would have bailed out creating a screen/context.

But all the same, we shouldn't let evil or confused userspace cause a
null ptr deref.

Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/adreno: print details in case of a protect fault interrupt
Craig Stout [Fri, 19 Feb 2016 00:50:03 +0000 (16:50 -0800)]
drm/msm/adreno: print details in case of a protect fault interrupt

Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/adreno: get CP_RPTR from register instead of shadow memory
Craig Stout [Fri, 19 Feb 2016 00:50:02 +0000 (16:50 -0800)]
drm/msm/adreno: get CP_RPTR from register instead of shadow memory

As described in the downstream/kgsl driver:
Sometimes the RPTR shadow memory is unreliable causing timeouts
in adreno_idle().  Read it directly from the register instead.

Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/adreno: add adreno430 power control
Craig Stout [Fri, 19 Feb 2016 00:50:01 +0000 (16:50 -0800)]
drm/msm/adreno: add adreno430 power control

Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/adreno: support for adreno 430.
Craig Stout [Fri, 19 Feb 2016 00:50:00 +0000 (16:50 -0800)]
drm/msm/adreno: support for adreno 430.

Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm: update generated headers
Rob Clark [Sat, 20 Feb 2016 18:37:58 +0000 (13:37 -0500)]
drm/msm: update generated headers

Pull in additional regs needed for a430, etc.

Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/dsi: fix definition of msm_dsi_pll_28nm_8960_init()
Luis Henriques [Wed, 3 Feb 2016 14:25:15 +0000 (14:25 +0000)]
drm/msm/dsi: fix definition of msm_dsi_pll_28nm_8960_init()

This fixes the following build failure:

drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm.o: In function `msm_dsi_pll_28nm_8960_init':
dsi_pll_28nm.c:(.text+0x1198): multiple definition of `msm_dsi_pll_28nm_8960_init'
drivers/gpu/drm/msm/dsi/pll/dsi_pll.o:dsi_pll.c:(.text+0x0): first defined here

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agodrm/msm/dsi: Parse DSI lanes via DT
Archit Taneja [Thu, 25 Feb 2016 05:49:48 +0000 (11:19 +0530)]
drm/msm/dsi: Parse DSI lanes via DT

The DSI driver is currently unaware of how the DSI physical data lanes
are mapped to the logical lanes provided by the DSI controller.

Create a DT binding "qcom,data-lane-map" that provides this information
on a given platform.

The MSM DSI controller is restricted in terms of what all mappings
it can support. The lane polarity is fixed for all the lanes, the clock
lanes are fixed, and the data lanes can be swapped among each other only
for a few combinations. Apply these restrictions when we parse the DT
data.

Cc: devicetree@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agodrm/omap: no need to select OMAP2_DSS
Tomi Valkeinen [Tue, 23 Feb 2016 15:34:34 +0000 (17:34 +0200)]
drm/omap: no need to select OMAP2_DSS

omapdss driver now depends on omapdrm, so we no longer should select
OMAP2_DSS from omapdrm's Kconfig.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: gem: Fix omap_gem_new() error path
Laurent Pinchart [Wed, 2 Mar 2016 10:51:19 +0000 (12:51 +0200)]
drm/omap: gem: Fix omap_gem_new() error path

When an error occurs in omap_gem_new() the function calls
omap_gem_free_object() to clean up. However, that function expects to be
called on a fully initialized GEM object and thus crashes.

Replace it by manual cleanup.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove -Werror from Makefile
Tomi Valkeinen [Tue, 1 Mar 2016 09:09:36 +0000 (11:09 +0200)]
drm/omap: remove -Werror from Makefile

Having -Werror in the omapdrm Makefile makes development and debugging a
PITA. Let's remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove dispc_ovl_check()
Tomi Valkeinen [Mon, 22 Feb 2016 16:22:30 +0000 (18:22 +0200)]
drm/omap: remove dispc_ovl_check()

dispc_ovl_check() is not used anywhere, so it can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove dss compat code
Tomi Valkeinen [Mon, 22 Feb 2016 14:11:45 +0000 (16:11 +0200)]
drm/omap: remove dss compat code

We have removed all the uses of compat code from omapdrm and the
non-compat parts of omapdss, so now we can remove all the compat code
itself.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove last uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 08:02:43 +0000 (10:02 +0200)]
drm/omap: remove last uses of omap_overlay_manager

We have now removed all uses of 'struct omap_overlay_manager', so we can
now remove the last places where it is set.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: DSI: remove uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 08:01:02 +0000 (10:01 +0200)]
drm/omap: DSI: remove uses of omap_overlay_manager

We are removing the uses of 'struct omap_overlay_manager'. This patch
changes DSI driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: VENC: remove uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 07:57:35 +0000 (09:57 +0200)]
drm/omap: VENC: remove uses of omap_overlay_manager

We are removing the uses of 'struct omap_overlay_manager'. This patch
changes VENC driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: SDI: remove uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 07:57:04 +0000 (09:57 +0200)]
drm/omap: SDI: remove uses of omap_overlay_manager

We are removing the uses of 'struct omap_overlay_manager'. This patch
changes SDI driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: HDMI4: remove uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 07:56:21 +0000 (09:56 +0200)]
drm/omap: HDMI4: remove uses of omap_overlay_manager

We are removing the uses of 'struct omap_overlay_manager'. This patch
changes HDMI4 driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: HDMI5: remove uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 07:55:01 +0000 (09:55 +0200)]
drm/omap: HDMI5: remove uses of omap_overlay_manager

We are removing the uses of 'struct omap_overlay_manager'. This patch
changes HDMI5 driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: DPI: remove uses of omap_overlay_manager
Tomi Valkeinen [Thu, 5 Nov 2015 07:52:00 +0000 (09:52 +0200)]
drm/omap: DPI: remove uses of omap_overlay_manager

We are removing the uses of 'struct omap_overlay_manager'. This patch
changes DPI driver to use 'omap_channel' instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove extra manager checks on disconnect
Tomi Valkeinen [Thu, 5 Nov 2015 07:44:53 +0000 (09:44 +0200)]
drm/omap: remove extra manager checks on disconnect

The DSS output drivers check 'dssdev->manager' in disconnect()
functions. This check is not needed as the manager must always be set if
the output device was connected. Remove the check.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove extra check in dpi and sdi
Tomi Valkeinen [Thu, 5 Nov 2015 07:41:12 +0000 (09:41 +0200)]
drm/omap: remove extra check in dpi and sdi

Both dpi and sdi check for 'mgr != NULL' in check_timings. This check is
not necessary, as mgr must always be set before check_timings. Remove
the check.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_unregister_framedone_handler to accept omap_channel
Tomi Valkeinen [Thu, 5 Nov 2015 07:23:47 +0000 (09:23 +0200)]
drm/omap: convert dss_mgr_unregister_framedone_handler to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_unregister_framedone_handler() to accept 'enum
omap_channel' instead of 'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_register_framedone_handler to accept omap_channel
Tomi Valkeinen [Thu, 5 Nov 2015 07:23:03 +0000 (09:23 +0200)]
drm/omap: convert dss_mgr_register_framedone_handler to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_register_framedone_handler() to accept 'enum
omap_channel' instead of 'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_start_update to accept omap_channel
Tomi Valkeinen [Thu, 5 Nov 2015 07:20:46 +0000 (09:20 +0200)]
drm/omap: convert dss_mgr_start_update to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_start_update() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_disable to accept omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 18:28:45 +0000 (20:28 +0200)]
drm/omap: convert dss_mgr_disable to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_disable() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_enable to accept omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 18:27:31 +0000 (20:27 +0200)]
drm/omap: convert dss_mgr_enable to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_enable() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_set_lcd_config to accept omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 18:26:15 +0000 (20:26 +0200)]
drm/omap: convert dss_mgr_set_lcd_config to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_set_lcd_config() to accept 'enum omap_channel' instead
of 'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_set_timings to accept omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 18:25:05 +0000 (20:25 +0200)]
drm/omap: convert dss_mgr_set_timings to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_set_timings() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_disconnect to accept omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 18:23:37 +0000 (20:23 +0200)]
drm/omap: convert dss_mgr_disconnect to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_disconnect() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_connect to accept omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 18:21:48 +0000 (20:21 +0200)]
drm/omap: convert dss_mgr_connect to accept omap_channel

We are removing uses of 'struct omap_overlay_manager'. This patch
changes dss_mgr_connect() to accept 'enum omap_channel' instead of
'struct omap_overlay_manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: use dispc_channel_connected in output drivers
Tomi Valkeinen [Thu, 5 Nov 2015 07:34:51 +0000 (09:34 +0200)]
drm/omap: use dispc_channel_connected in output drivers

Use 'out->dispc_channel_connected' to check if the device is connected
to an overlay manager or not, instead of using 'out->manager'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: add dispc_channel_connected field to omap_dss_device
Tomi Valkeinen [Thu, 5 Nov 2015 07:34:31 +0000 (09:34 +0200)]
drm/omap: add dispc_channel_connected field to omap_dss_device

We want to remove the 'struct omap_overlay_manager' from
omap_dss_device. At the moment that field is used, among some other
uses, to see if the omap_dss_device is connected to an overlay manager.

To make it possible to remove the 'struct omap_overlay_manager' field,
this patch adds 'bool dispc_channel_connected' field to track the
connected-or-not status.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: convert dss_mgr_ops to use omap_channel
Tomi Valkeinen [Wed, 4 Nov 2015 17:36:26 +0000 (19:36 +0200)]
drm/omap: convert dss_mgr_ops to use omap_channel

We are removing the use of 'struct omap_overlay_manager' from omapdrm.
This patch changes the function pointers in 'dss_mgr_ops' to get 'enum
omap_channel' parameter instead of 'struct omap_overlay_manager'.

The change is very straightforward, as we still use 'struct
omap_overlay_manager' inside the function implementations where needed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove use of omapdss_find_mgr_from_display()
Tomi Valkeinen [Wed, 21 Oct 2015 13:17:23 +0000 (16:17 +0300)]
drm/omap: remove use of omapdss_find_mgr_from_display()

In order to remove uses of 'struct omap_overlay_manager' we need to get
rid of using omapdss_find_mgr_from_display() when initializing omapdrm.

Instead of using omapdss_find_mgr_from_display() and mgr->id to find the
dispc channel used for the given display, we can instead use
omapdss_find_output_from_display(), and get the output->dispc_channel
from there.

We can also remove omapdss_find_mgr_from_display() as it's no longer
used.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: remove crtc->mgr field
Tomi Valkeinen [Wed, 21 Oct 2015 13:34:08 +0000 (16:34 +0300)]
drm/omap: remove crtc->mgr field

In order to remove uses of 'struct omap_overlay_manager' from omapdrm,
this patch removes the crtc->mgr field.

To accomplish that, a new static array is added along the current
'omap_crtcs' static array, which is used to store the output device
connected to a crtc.

Optimally we'd use the struct omap_crtc to store this information, but
at the time when omap_crtc_dss_connect() is called, we don't yet have
the omap_crtc instances. This might possibly be fixed later, but for now
the static array does the job.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: Add dispc_mgr_get_supported_outputs()
Tomi Valkeinen [Wed, 4 Nov 2015 13:11:25 +0000 (15:11 +0200)]
drm/omap: Add dispc_mgr_get_supported_outputs()

We are removing the use of the 'struct omap_overlay_manager' from
omapdrm, and one part of that is removing the use of
mgr->supported_outputs field.

This patch adds dispc_mgr_get_supported_outputs() function which can be
used instead of mgr->supported_outputs. omap_crtc.c is changed to use
the new function.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: move dss_mgr_* declarations to omapdrm/omapfb
Tomi Valkeinen [Fri, 19 Feb 2016 15:37:09 +0000 (17:37 +0200)]
drm/omap: move dss_mgr_* declarations to omapdrm/omapfb

This patch continues the work to create private versions of the
omapdss.h header for omapdrm and omapfb. This one moves the dss_mgr_*
function declarations.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: move struct dss_mgr_ops to omapdrm/omapfb
Tomi Valkeinen [Fri, 19 Feb 2016 15:19:41 +0000 (17:19 +0200)]
drm/omap: move struct dss_mgr_ops to omapdrm/omapfb

This patch continues the work to create private versions of the
omapdss.h header for omapdrm and omapfb. This one moves 'struct dss_mgr_ops'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap, omapfb: move exported dispc function declarations to omapdrm/omapfb
Tomi Valkeinen [Fri, 19 Feb 2016 14:54:36 +0000 (16:54 +0200)]
drm/omap, omapfb: move exported dispc function declarations to omapdrm/omapfb

omapdrm and omapfb still share the same include/video/omapdss.h. We need
to change that so that we can proceed with omapdrm work.

However, it's not trivial to make separate omapfb and omapdrm versions
of omapdss.h, as that file is also included in other places like arch
code, audio code and omap_vout code. So we'll do it piece by piece.

This patch makes private versions of all the dispc function declarations
that are in omapdss.h. For omapdrm we create a new file,
drivers/gpu/drm/omapdrm/dss/omapdss.h, which will contain headers meant
to be visible outside omapdss.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: panel-tpo-td043mtea1: remove pdata support
Tomi Valkeinen [Mon, 22 Feb 2016 16:14:52 +0000 (18:14 +0200)]
drm/omap: panel-tpo-td043mtea1: remove pdata support

We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: panel-tpo-td028ttec1: remove pdata support
Tomi Valkeinen [Mon, 22 Feb 2016 16:14:33 +0000 (18:14 +0200)]
drm/omap: panel-tpo-td028ttec1: remove pdata support

We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: panel-nec-nl8048hl11: remove pdata support
Tomi Valkeinen [Thu, 18 Feb 2016 15:27:55 +0000 (17:27 +0200)]
drm/omap: panel-nec-nl8048hl11: remove pdata support

We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: panel-sharp-ls037v7dw01: remove pdata support
Tomi Valkeinen [Mon, 22 Feb 2016 16:13:36 +0000 (18:13 +0200)]
drm/omap: panel-sharp-ls037v7dw01: remove pdata support

We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: panel-lgphilips-lb035q02: remove pdata support
Tomi Valkeinen [Thu, 18 Feb 2016 15:22:54 +0000 (17:22 +0200)]
drm/omap: panel-lgphilips-lb035q02: remove pdata support

We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: connector-hdmi: remove pdata support
Tomi Valkeinen [Thu, 18 Feb 2016 15:20:54 +0000 (17:20 +0200)]
drm/omap: connector-hdmi: remove pdata support

We no longer have any boards that require the platform data support from
the connector, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: connector-dvi: remove pdata support
Tomi Valkeinen [Thu, 18 Feb 2016 15:18:41 +0000 (17:18 +0200)]
drm/omap: connector-dvi: remove pdata support

We no longer have any boards that require the platform data support from
the connector, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: encoder-tfp410: remove pdata support
Tomi Valkeinen [Thu, 18 Feb 2016 15:14:54 +0000 (17:14 +0200)]
drm/omap: encoder-tfp410: remove pdata support

We no longer have any boards that require the platform data support from
the encoder, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: panel-dsi-cm: remove pdata support
Tomi Valkeinen [Thu, 18 Feb 2016 15:12:46 +0000 (17:12 +0200)]
drm/omap: panel-dsi-cm: remove pdata support

We no longer have any boards that require the platform data support from
the panel, so we can remove the related code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: omapdss.h: remove omap_hdmi_init
Tomi Valkeinen [Thu, 18 Feb 2016 14:27:53 +0000 (16:27 +0200)]
drm/omap: omapdss.h: remove omap_hdmi_init

omap_hdmi_init() function does not exist anymore, so we can remove the
declaration.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: omapdss.h: remove unused struct omap_dss_hdmi_data
Tomi Valkeinen [Fri, 19 Feb 2016 14:59:38 +0000 (16:59 +0200)]
drm/omap: omapdss.h: remove unused struct omap_dss_hdmi_data

'struct omap_dss_hdmi_data' is not used anywhere, so we can remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: move dss_suspend/resume_all to core.c
Tomi Valkeinen [Fri, 19 Feb 2016 16:05:14 +0000 (18:05 +0200)]
drm/omap: move dss_suspend/resume_all to core.c

core.c is the only caller of dss_disable_all_devices(). We can thus move
the function from display.c to core.c and make it static.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: fix suspend/resume handling
Tomi Valkeinen [Fri, 2 Oct 2015 08:10:42 +0000 (11:10 +0300)]
drm/omap: fix suspend/resume handling

For legacy reasons omapdss handles system suspend/resume via PM notifier
callback, where the driver disables/resumes all the outputs.

This doesn't work well with omapdrm. What happens on suspend is that the
omapdss disables the displays while omapdrm is still happily continuing
its work, possibly waiting for an vsync irq, which will never come if
the display output is disabled, leading to timeouts and errors sent to
userspace.

This patch moves the suspend/resume handling to omapdrm, and the
suspend/resume is now done safely inside modeset lock.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: check if rotation is supported before commit
Tomi Valkeinen [Thu, 27 Aug 2015 10:09:22 +0000 (13:09 +0300)]
drm/omap: check if rotation is supported before commit

omapdrm is missing a check on the validity of the rotation property.
This leads to omapdrm possibly trying to use rotation on non-rotateable
framebuffer, which causes the overlay setup to fail.

This patch adds the necessary check to omap_plane_atomic_check().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: fix crtc->plane property delegation
Tomi Valkeinen [Thu, 18 Feb 2016 16:47:14 +0000 (18:47 +0200)]
drm/omap: fix crtc->plane property delegation

Before universal planes we had to have plane specific properties for the
crtc too, as on the hardware level a crtc uses a plane. In other words,
e.g. 'zorder' property was added to both planes and crtcs, and
omap_crtc.c would delegate the property set/get to the primary plane.

However, the delegation was a bit too generic, delegating all property
set/get calls to planes. Thus it's possible to set, say, FB_ID, on a
crtc, which gets redirected to  the primary plane.

This is not standard, and shouldn't be allowed. To keep backward
compatibility, we still need to redirect the properties we supported
earlier for crtcs, namely 'zorder' and 'rotation'.

This patch redirects only the allowed properties from crtcs to planes.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: EBUSY status handling in omap_gem_fault()
Rob Clark [Sun, 20 Oct 2013 16:07:42 +0000 (12:07 -0400)]
drm/omap: EBUSY status handling in omap_gem_fault()

Subsequent threads returning EBUSY from vm_insert_pfn() was not
handled correctly. As a result concurrent access from new threads
to mmapped data caused SIGBUS.

See e79e0fe380847493266fba557217e2773c61bd1b ("drm/i915: EBUSY status
handling added to i915_gem_fault()").

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: verify that fb plane pitches are the same
Tomi Valkeinen [Fri, 8 Jan 2016 13:51:02 +0000 (15:51 +0200)]
drm/omap: verify that fb plane pitches are the same

The DSS hardware uses the same ROW_INC value for both Y and UV planes
for NV12 format. This means that the pitches of the Y and UV planes have
to match. omapdrm doesn't check this at the moment, and this can lead
into a broken NV12 fb on the screen.

This patch adds the check.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: verify that display x-res is divisible by 8
Tomi Valkeinen [Tue, 5 Jan 2016 09:43:18 +0000 (11:43 +0200)]
drm/omap: verify that display x-res is divisible by 8

DISPC requires the x resolution to be divisible by 8 when stall mode is
not used.

Add a check to the DPI driver to verify this.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: HDMI5: allow interlace
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:40 +0000 (18:41 +0200)]
drm/omap: HDMI5: allow interlace

Now that interlace support has been added, we can remove the check that
prevents interlace.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: HDMI5: Add interlace support
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:39 +0000 (18:41 +0200)]
drm/omap: HDMI5: Add interlace support

Add the missing bits for interlace:

* Set VBLANK_OSC if the videomode's vblank is fractional
* Halve the vertical timings for interlace
* Double the horizontal timings for double-pixel mode
* Set FC_PRCONF properly for double-pixel mode

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: HDMI5: clean up timings copy
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:38 +0000 (18:41 +0200)]
drm/omap: HDMI5: clean up timings copy

The HDMI driver copies the timing values one by one. Instead we can just
copy the whole struct.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: HDMI5: Fix FC HSW value
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:37 +0000 (18:41 +0200)]
drm/omap: HDMI5: Fix FC HSW value

For some reason the HDMI FC's HSW value is programmed to hsw-1. There's
no indication in the documentation that this would be correct, and no
other blanking value needs -1 either.

So remove the -1.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: DISPC: Fix field order for HDMI
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:36 +0000 (18:41 +0200)]
drm/omap: DISPC: Fix field order for HDMI

Interlace field order is different between VENC and HDMI. The driver
currently sets the field order for VENC.

This patch adds the code to set the field order for HDMI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: HDMI: fix WP timings for ilace
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:35 +0000 (18:41 +0200)]
drm/omap: HDMI: fix WP timings for ilace

The HDMI WP timings are not programmed correctly for interlace.

We need to halve the vertical timings when interlace is used, and double
the horizontal timings when pixel doubling is used.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: HDMI: Fix HSW value
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:34 +0000 (18:41 +0200)]
drm/omap: HDMI: Fix HSW value

On OMAP4 and OMAP5 ES1.0 the HDMI_WP_VIDEO_TIMING_H:HSW field is
set directly to the HSW value. On later SoCs the field needs to be
programmed with the value of HSW-1.

Currently the driver always programs the field with the HSW value. Most
videomodes seem to work fine with that, but at least low resolution
interlaced modes don't work at all.

This patch fixes the HSW for OMAP5 ES2.0+ SoCs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: HDMI: support double-pixel pixel clock
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:33 +0000 (18:41 +0200)]
drm/omap: HDMI: support double-pixel pixel clock

We need double-pixel mode (pixel repetition) for interlace modes. This
patch adds the necessary support to HDMI to double the pixel clock when
double-pixel mode is used.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: support double-pixel
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:32 +0000 (18:41 +0200)]
drm/omap: support double-pixel

We need double-pixel mode (pixel repetition) for interlace modes. This
patch adds the necessary support to omapdrm to output double-pixel mode.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: DISPC: support double-pixel mode
Tomi Valkeinen [Wed, 13 Jan 2016 16:41:31 +0000 (18:41 +0200)]
drm/omap: DISPC: support double-pixel mode

We need double-pixel mode (pixel repetition) for interlace modes. This
patch adds the necessary support to DISPC to output double-pixel mode.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: increase vblank wait timeout
Tomi Valkeinen [Thu, 19 Nov 2015 15:31:25 +0000 (17:31 +0200)]
drm/omap: increase vblank wait timeout

omap_crtc_wait_pending() waits until the config changes have been taken
into use, usually at next vblank. The wait-timeout used is 50ms, which
usually is enough, but in some rare cases not.

As time wait-timeout is just a safety measure for cases where something
is broken, we can just as well increase the timeout considerably.

This patch makes the timeout 250ms.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: remove support for ext mem & sync
Tomi Valkeinen [Wed, 27 Jan 2016 08:58:43 +0000 (10:58 +0200)]
drm/omap: remove support for ext mem & sync

We no longer have the omapdrm plugin system for SGX, and we can thus
remove the support for external memory and sync objects from omap_gem.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: gem: Implement dma_buf import
Laurent Pinchart [Mon, 14 Dec 2015 20:39:44 +0000 (22:39 +0200)]
drm/omap: gem: Implement dma_buf import

OMAP GEM objects backed by dma_buf reuse the current OMAP GEM object
support as much as possible. If the imported buffer is physically
contiguous its physical address will be used directly, reusing the
OMAP_BO_MEM_DMA_API code paths. Otherwise it will be mapped through the
TILER using a pages list created from the scatterlist instead of the
shmem backing storage.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: gem: Refactor GEM object allocation
Laurent Pinchart [Mon, 14 Dec 2015 20:39:43 +0000 (22:39 +0200)]
drm/omap: gem: Refactor GEM object allocation

Split the individual steps of GEM object allocation and initialization
clearly. This improves readability and prepares for dma_buf import
support.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: gem: Clean up GEM objects memory flags
Laurent Pinchart [Mon, 14 Dec 2015 20:39:37 +0000 (22:39 +0200)]
drm/omap: gem: Clean up GEM objects memory flags

The driver assumes that only objects backed by shmem need to be mapped
through DMM. While this is true with the current code, the assumption
won't hold with dma_buf import support.

Condition the mapping based on whether the buffer has been allocated
using the DMA mapping API instead and clean up the flags to avoid having
to check both flags and GEM object filp field to decide how to process
buffers. Flags are not the authoritative source of information regarding
where the buffer memory comes from, and are renamed to make that
clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 years agodrm/omap: print an error if display enable fails
Tomi Valkeinen [Tue, 5 Jan 2016 09:43:16 +0000 (11:43 +0200)]
drm/omap: print an error if display enable fails

If the panel's enable fails, omap_encoder silently ignores the failure.
omapdrm should really handle the failure, but unfortunately the whole
encoder enable codepath is expected to always succeed.

So for now, catch the enable failure and print an error.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: use dma_mapping_error in omap_gem_dma_sync
Tomi Valkeinen [Tue, 5 Jan 2016 09:43:15 +0000 (11:43 +0200)]
drm/omap: use dma_mapping_error in omap_gem_dma_sync

omap_gem_dma_sync() calls dma_map_page() but does not check the possible
error with dma_mapping_error(). If DMA-API debugging is enabled, the
debug layer will give a warning if dma_mapping_error() has not been
used.

This patch adds proper error handling to omap_gem_dma_sync().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: use dma_mapping_error in omap_gem_attach_pages
Tomi Valkeinen [Tue, 5 Jan 2016 09:43:14 +0000 (11:43 +0200)]
drm/omap: use dma_mapping_error in omap_gem_attach_pages

omap_gem_attach_pages() calls dma_map_page() but does not check the
possible error with dma_mapping_error(). If DMA-API debugging is
enabled, the debug layer will give a warning if dma_mapping_error() has
not been used.

This patch adds proper error handling to omap_gem_attach_pages().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: add define for DISPC_IRQ_WBUNCOMPLETEERROR
Tomi Valkeinen [Wed, 4 Nov 2015 15:10:40 +0000 (17:10 +0200)]
drm/omap: add define for DISPC_IRQ_WBUNCOMPLETEERROR

OMAP4+ DSS has WBUNCOMPLETEERROR irq, which was not defined in the irq
list. Add the define.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 years agodrm/omap: tpd12s015: CT_CP_HPD as optional gpio
Manisha Agrawal [Tue, 3 Nov 2015 21:22:50 +0000 (15:22 -0600)]
drm/omap: tpd12s015: CT_CP_HPD as optional gpio

tpd12s015 HW has LS_OE, CT_CP_HPD and HPD gpios. Out of these gpios,
driver only handled LS_OE as optional. The CT_CP_HPD gpio should also
be treated as optional gpio as it is just a power saving feature. Some
boards hardwire this gpio to be always enable. In this patch, all access
to CT_CP_HPD gpio is made optional.

Signed-off-by: Manisha Agrawal <manisha.agrawal@ti.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>