aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-03Merge branch 'drm-etnaviv-next' of https://git.pengutronix.de/git/lst/linux ↵Dave Airlie14-123/+329
into drm-next It includes code cleanups from Bhumika and Liviu, a significant shader performance fix and additions to the cmdstream validator from Wladimir and the addition of a cmdbuf suballocator by myself. The suballocator improves performance on all chips by reducing the CPU overhead of the kernel driver and side steps the GC3000 FE MMU flush erratum, now making the workarounds in IOVA allocation we had before unnecessary, which results in a nice cleanup of the code in that area. * 'drm-etnaviv-next' of https://git.pengutronix.de/git/lst/linux: drm/etnaviv: Remove duplicate header file include Revert "drm/etnaviv: trick drm_mm into giving out a low IOVA" drm/etnaviv: add cmdbuf suballocator drm/etnaviv: get cmdbuf physical address through the cmdbuf abstraction drm/etnaviv: wire up iova handling in new cmdbuf abstraction drm/etnaviv: move cmdbuf de-/allocation into own file drm/etnaviv: always flush MMU TLBs on map/unmap drm/etnaviv: constify etnaviv_iommu_ops structures drm/etnaviv: set up initial PULSE_EATER register drm/etnaviv: add new GC3000 sensitive states
2017-02-02drm: Fix build when FBDEV_EMULATION is disabledGabriel Krisman Bertazi1-1/+1
Commit be7f735cd5ea ("drm: Rely on mode_config data for fb_helper initialization") broke the build when CONFIG_DRM_FBDEV_EMULATION is disabled because it didn't update the prototype for drm_fb_helper_init in that case. Fixes: be7f735cd5ea ("drm: Rely on mode_config data for fb_helper initialization") Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm: Rely on mode_config data for fb_helper initializationGabriel Krisman Bertazi38-73/+43
Instead of receiving the num_crts as a parameter, we can read it directly from the mode_config structure. I audited the drivers that invoke this helper and I believe all of them initialize the mode_config struct accordingly, prior to calling the fb_helper. I used the following coccinelle hack to make this transformation, except for the function headers and comment updates. The first and second rules are split because I couldn't find a way to remove the unused temporary variables at the same time I removed the parameter. // <smpl> @r@ expression A,B,D,E; identifier C; @@ ( - drm_fb_helper_init(A,B,C,D) + drm_fb_helper_init(A,B,D) | - drm_fbdev_cma_init_with_funcs(A,B,C,D,E) + drm_fbdev_cma_init_with_funcs(A,B,D,E) | - drm_fbdev_cma_init(A,B,C,D) + drm_fbdev_cma_init(A,B,D) ) @@ expression A,B,C,D,E; @@ ( - drm_fb_helper_init(A,B,C,D) + drm_fb_helper_init(A,B,D) | - drm_fbdev_cma_init_with_funcs(A,B,C,D,E) + drm_fbdev_cma_init_with_funcs(A,B,D,E) | - drm_fbdev_cma_init(A,B,C,D) + drm_fbdev_cma_init(A,B,D) ) @@ identifier r.C; type T; expression V; @@ - T C; <... when != C - C = V; ...> // </smpl> Changes since v1: - Rebased on top of the tip of drm-misc-next. - Remove mention to sti since a proper fix got merged. Suggested-by: Daniel Vetter <[email protected]> Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm: Provide a driver hook for drm_dev_release()Chris Wilson2-20/+58
Some state is coupled into the device lifetime outside of the load/unload timeframe and requires teardown during final unreference from drm_dev_release(). For example, dmabufs hold both a device and module reference and may live longer than expected (i.e. the current pattern of the driver tearing down its state and then releasing a reference to the drm device) and yet touch driver private state when destroyed. v2: Export drm_dev_fini() and move the responsibility for finalizing the drm_device and freeing it to the release callback. (If no callback is provided, the core will call drm_dev_fini() and kfree(dev) as before.) v3: Remember to add drm_dev_fini() to drm_drv.h v4: Tidy language for kerneldoc v5: Cross reference from drm_dev_init() to note that driver->release() allows for arbitrary embedding. v6: Refer to driver data rather than driver state, as state is now becoming associated with the struct drm_atomic_state and friends. Signed-off-by: Chris Wilson <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Daniel Vetter <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> [danvet: Use the proper reference for struct members, which is &drm_driver.release.] Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm: meson: rename driver name to meson-drmNeil Armstrong1-2/+1
The platform driver name is currently "meson" which can lead to some confusion, this patch renames it to "meson-drm" and removes the owner attribute since is always added by __platform_driver_register called by the module_platform_driver() macro. Signed-off-by: Neil Armstrong <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm: meson: rename module name to meson-drmNeil Armstrong1-3/+3
The module is currently named "meson.ko" which can lead to some confusion, this patches renames it "meson-drm.ko" Signed-off-by: Neil Armstrong <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: enable interlace modesAndrzej Hajda1-3/+0
Bug in DECON(CRTC) driver prevented interlace modes from proper work. Since DECON is fixed interlace modes can be enabled in MHL. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: enable MHL3 mode if possibleAndrzej Hajda1-11/+12
Since all sub-protocols of MHL3 are already supported MHL3 mode can be enabled. With this patch it is possible to use packed pixel modes and clocks up to 300MHz - 1920x1080@60Hz and 4K modes. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: add HSIC initialization codeAndrzej Hajda2-4/+44
In case of MHL3 HSIC should be initialized. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: improve gen2 write burst IRQ routineAndrzej Hajda1-1/+20
The patch adds code to report back feature complete IRQ, and code to read and drop burst writes from peer. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: send EMSC features on requestAndrzej Hajda2-12/+31
Device should report to the peer which features are really supported. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: rewrite hdmi start sequenceAndrzej Hajda2-33/+262
MHL3 protocol requires registry adjustments depending on chosen video mode. Necessary information is gathered in mode_fixup callback. In case of HDMI video modes driver should also send special AVI and MHL3 infoframes. The patch introduces generic helpers for handling MHL3 infoframes, in case of appearance of other users of MHL3 infoframes these function can be moved to common library. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/mhl: add MHL3 infoframe related definitionsAndrzej Hajda1-0/+32
MHL3 protocol uses vendor specific infoframes to transmit additional information to the sink. This patch adds definitions of structures and constants used to create such frames. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: fix disconnect sequenceAndrzej Hajda1-1/+3
The patch allows to avoid rare cases when discovery fails. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: split EDID read and write codeAndrzej Hajda1-4/+27
MHL3 requires that after reading EDID from the sink source should ask peer for features. To make both protocols happy the patch splits the code accordingly. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: add delay during cbus resetAndrzej Hajda1-5/+4
Without delay CBUS sometimes was not reset properly. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: do not stop MHL output when TMDS input is stoppedAndrzej Hajda1-13/+0
Stopping output causes full re-detection of the sink and slows down the process. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: set gen2 write burst before sending MSC commandAndrzej Hajda1-38/+50
Write burst should be enabled for MHL_INT_RC_FEAT_REQ and disabled for other commands. The patch moves functions up and adds delay setting for MHL3 burst mode. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: abstract out sink detection codeAndrzej Hajda1-15/+20
MHL1 and MHL3 have different initialization paths. To make both protocols happy sink detection is put into continuation after link mode enablement. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: fix initialization sequence for MHL2 receiversAndrzej Hajda1-2/+1
MHL2 receiver require disabling transmitter on initialization. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: fix MSC message removalAndrzej Hajda1-1/+1
Messages queue can be cleaned up by message callbacks, to avoid repeated removal of current message it should be removed from the queue before calling these callbacks. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: remove spare CBUS bring-up sequenceAndrzej Hajda1-4/+0
In case of MHL3 CBUS is bring-up already in sii8620_got_ecbus_speed. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: fix peer device capabilities read codeAndrzej Hajda1-1/+11
Peer capabilities should be read differently depending on protocol version. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: respond to feature requestsAndrzej Hajda1-0/+4
MHL3 protocol requires device to respond to feature request from peer. This minimal answer fulfills the requirement and allows to continue negotiation. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: add support for burst eMSC transmissionsAndrzej Hajda2-1/+197
Burst transmissions are used in MHL3 mode negotiation. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/mhl: add write burst related definitionsAndrzej Hajda1-0/+53
Burst transmissions are required in MHL3 modes. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: initial support for eCBUS-S modeAndrzej Hajda2-2/+107
The Single-ended eCBUS Mode (eCBUS-S) mode provides 60 Mb/s full-duplex bidirectional traffic for three channels: - CBUS data (CBUS1 channel), - High-bandwidth MHL data (eMSC channel), - tunneling data (T-CBUS channel). It is required to fully support MHL3 dongles. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: add continuations to messagesAndrzej Hajda1-0/+20
Due to asynchronous nature of MHL flow of execution is dispersed. Logical continuation of some actions happens after response of peer, i.e in interrupt handler. To simplify coding continuation mechanism has been added - it is now possible to provide continuation callback, which will be called after peer responds to given action. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: add reading device capability registersAndrzej Hajda1-0/+35
This functionality is necessary to implement MHL3 modes. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: add MHL3 mode check helperAndrzej Hajda1-2/+7
MHL3 modes differs significantly from MHL1 mode, this helper will be used frequently to clearly distinguish them. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/bridge/sii8620: simplify MHL3 mode settingAndrzej Hajda1-6/+2
It is not necessary to set REG_COC_CTL0, REG_MHL_COC_CTL1 registers. Signed-off-by: Andrzej Hajda <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-02drm/etnaviv: Remove duplicate header file includeLiviu Dudau1-1/+0
etnaviv_gem.h header gets included twice. Remove duplicate. Signed-off-by: Liviu Dudau <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
2017-02-02Revert "drm/etnaviv: trick drm_mm into giving out a low IOVA"Lucas Stach1-6/+1
Now that commandstreams are handled through the cmdbuf suballocator the workaround to make the IOVA games work is not needed anymore. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
2017-02-02drm/etnaviv: add cmdbuf suballocatorLucas Stach7-58/+165
There are 3 big benefits to suballocating a single big DMA buffer for command submission: 1. Avoid hammering CMA. The old way of allocating and freeing a DMA buffer for each submission was hitting some of the real slow pathes in CMA, as this allocator was not designed for a concurrent small buffers load. 2. Less TLB flushes on IOMMUv2. If a new command buffer is mapped into the GPU address space the MMU TLBs need to be flushed. By having one big buffer statically mapped to the GPU, a lot of those flushes can be avoided. 3. No funky workarounds for GC3000. The FE TLB flush on GC3000 isn't reliable. To work around that we tried to lay out the cmdbufs in the GPU address space in a way to avoid this issue. This hasn't always worked if the address space is crowded. A single statically mapped buffer avoids the erratum completely. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
2017-02-02drm/etnaviv: get cmdbuf physical address through the cmdbuf abstractionLucas Stach4-2/+10
Don't allow IOMMUv2 to peek directly into the cmdbuf, but get the needed PA through a dedicated function. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
2017-02-02drm/etnaviv: wire up iova handling in new cmdbuf abstractionLucas Stach5-11/+18
Don't call the IOMMU directly, but go through the new cmdbuf abstraction. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
2017-02-02drm/etnaviv: move cmdbuf de-/allocation into own fileLucas Stach11-66/+117
This will get more complex with the following changes, so move it into its own place. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
2017-02-02drm/etnaviv: always flush MMU TLBs on map/unmapLucas Stach1-4/+3
This ensures that the GPU isn't able to write into already freed objects, as doing this in the IOVA reaper isn't enough, as the gem_free_object path will also cause unmaps to happen. On MMUv2 this also ensures that stale entries, which may have been prefetched into the TLB will be purged. The flush is low overhead, as it gets batched up with the next user command buffer, so this isn't incuring an overhead for each buffer map/unmap. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
2017-02-02drm/etnaviv: constify etnaviv_iommu_ops structuresBhumika Goyal2-2/+2
Declare etnaviv_iommu_ops structure as const as it is only used when the reference of one of its field is stored in the ops field of a iommu_domain structure. This ops field is of type const, so etnaviv_iommu_ops structures having similar properties can be declared const too. Done using Coccinelle. Before and after size details of .o file remains the same after cross compiling for arm architecture. lst: Trimmed commit message, apply the same change to iommu_v2. Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
2017-02-02drm: qxl: Embed drm_device into driver structureGabriel Krisman Bertazi10-57/+52
This is the recommended way to create the drm_device structure, according to DRM documentation. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2017-02-02drm: qxl: Drop duplicated pci_device pointer attributeGabriel Krisman Bertazi3-3/+1
qxl_device duplicates the pointer to struct pci_dev, which is not needed since we already have it in the drm_device structure. Clean it up. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2017-02-02drm: qxl: Drop duplicated device pointer attributeGabriel Krisman Bertazi4-14/+12
qxl_device duplicates a pointer to struct device, which is not needed since we already have it in the drm_device structure. Clean it up. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2017-02-02drm: qxl: Drop misleading commentGabriel Krisman Bertazi1-1/+1
No longer true since commit 07f8d9bdb235 ("drm/qxl: add support for > 1 output"). qxl_num_crtc defaults to 4 and is configurable as a module parameter. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2017-02-02drm/bochs: Implement nomodesetMax Staudt1-0/+10
Up until now, the bochsdrm driver didn't handle the nomodeset option at boot, and didn't provide a "modeset" module option either. This patch implements both. The new parameter can be used by specifying bochs-drm.modeset=0 at boot time. Signed-off-by: Max Staudt <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Cc: Gerd Hoffmann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
2017-02-01drm/vc4: Add DSI driverEric Anholt6-0/+1735
The DSI0 and DSI1 blocks on the 2835 are related hardware blocks. Some registers move around, and the featureset is slightly different, as DSI1 (the 4-lane DSI) is a later version of the hardware block. This driver doesn't yet enable DSI0, since we don't have any hardware to test against, but it does put a lot of the register definitions and code in place. v2: Use the clk_hw interfaces, don't set CLK_IS_BASIC (from review by Stephen Boyd) Signed-off-by: Eric Anholt <[email protected]> Acked-by: Daniel Vetter <[email protected]> (v1) Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-01dt-bindings: Document the VC4 DSI module nodes.Eric Anholt1-0/+35
These are part of the vc4 display pipeline. Signed-off-by: Eric Anholt <[email protected]> Acked-by: Rob Herring <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-01drm/vc4: Add support for feeding DSI encoders from the pixel valve.Eric Anholt2-14/+21
We have to set a different pixel format, which tells the hardware to use the pix_width field that's fed in sideband from the DSI encoder to divide the "pixel" clock. Signed-off-by: Eric Anholt <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-01drm/vc4: Set up SCALER_DISPCTRL at boot.Eric Anholt2-0/+17
We want the HVS on, obviously, and we also want DSP3 (PV1's source) to be muxed from HVS channel 2 like we expect in vc4_crtc.c. The firmware wasn't setting the DSP3 mux up when both the LCD and HDMI were disabled. Signed-off-by: Eric Anholt <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-02-01drm: Clean up the 1366x768 fixup codesTakashi Iwai3-9/+10
This is just a cleanup, no functional change. The fixup code for 1366x768 in drm_mode_create_from_cmdline_mode() is basically a copy of the existing code in drm_edid.c. Make the latter code public so that it can be called from the former function. Signed-off-by: Takashi Iwai <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Ville Syrjälä <[email protected]> [vsyrjala: include drm_crtc_internal.h to make sparse happy] Signed-off-by: Ville Syrjälä <[email protected]>
2017-02-01Merge remote-tracking branch 'airlied/drm-next' into drm-misc-nextDaniel Vetter875-12647/+16388
Backmerge to resync and also so that Ville can apply a cleanup patch from Takashi. Signed-off-by: Daniel Vetter <[email protected]>