drm: add prime helpers

Instead of reimplementing all of the dma_buf functionality in every driver,
create helpers drm_prime_import and drm_prime_export that implement them in
terms of new, lower-level hook functions:

  gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT
  gem_prime_get_sg_table: convert a drm_gem_object to an sg_table for export
  gem_prime_import_sg_table: convert an sg_table into a drm_gem_object
  gem_prime_vmap, gem_prime_vunmap: map and unmap an object

These hooks are optional; drivers can opt in by using drm_gem_prime_import and
drm_gem_prime_export as the .gem_prime_import and .gem_prime_export fields of
struct drm_driver.

v2:
- Drop .begin_cpu_access.  None of the drivers this code replaces implemented
  it.  Having it here was a leftover from when I was trying to include i915 in
  this rework.
- Use mutex_lock instead of mutex_lock_interruptible, as these three drivers
  did.  This patch series shouldn't change that behavior.
- Rename helpers to gem_prime_get_sg_table and gem_prime_import_sg_table.
  Rename struct sg_table* variables to 'sgt' for clarity.
- Update drm.tmpl for these new hooks.

v3:
- Pass the vaddr down to the driver.  This lets drivers that just call vunmap on
  the pointer avoid having to store the pointer in their GEM private structures.
- Move documentation into a /** DOC */ comment in drm_prime.c and include it in
  drm.tmpl with a !P line.  I tried to use !F lines to include documentation of
  the individual functions from drmP.h, but the docproc / kernel-doc scripts
  barf on that file, so hopefully this is good enough for now.
- apply refcount fix from commit be8a42ae60addd8b6092535c11b42d099d6470ec
  ("drm/prime: drop reference on imported dma-buf come from gem")

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 89177644a7b6306e6084a89eab7e290f4bfef397)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I0797a9f73a6ee3a9788426150ed8d23aa65f8611
Reviewed-on: https://chromium-review.googlesource.com/190601
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/gem: remove drm_gem_object_handle_unreference

It's unused, everyone is using the _unlocked variant only.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
(cherry picked from commit da5cbe361c55fe17ef94d2587991997f81f8c4cb)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I6be92d18ea51535cac0a16d0556d44d4db4ba948
Reviewed-on: https://chromium-review.googlesource.com/190602
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/gem: move drm_gem_object_handle_unreference_unlocked into drm_gem.c

We have three callers of this function now and it's neither
performance critical nor really small. So an inline function feels
like overkill and unecessarily separates the different parts of the
code.

Since all callers of drm_gem_object_handle_free are now in drm_gem.c
we can make that static (and remove the unused EXPORT_SYMBOL). To
avoid a forward declaration move it (and drm_gem_object_free_bug) up a
bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 36da5908a275d6319c17e758b5bde89b4f573959)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Conflicts:
	include/drm/drmP.h

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: Iabc650a5e8453ccdeedb2cc265ef59ab77888741
Reviewed-on: https://chromium-review.googlesource.com/190603
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm: modify pages_to_sg prime helper to create optimized SG table

It fixes the issue arises due to passing 'nr_pages' in place of 'nents' to
sg_alloc_table. When ARM_HAS_SG_CHAIN is disabled, it is causing failure in
creating SG table for the buffers having more than 204 physical pages i.e.
equal to SG_MAX_SINGLE_ALLOC.

When using sg_alloc_table_from_pages interface, in place of sg_alloc_table,
page list will be passes to get each contiguous section which is represented
by a single entry in the table. For a Contiguous Buffer, number of entries
should be equal to 1.

Following check is causing the failure which is not applicable for Non-Contig
buffers:

	if (WARN_ON_ONCE(nents > max_ents))
		return -EINVAL;

Above patch is well tested for EXYNOS4 and EXYNOS5 for with/wihtout IOMMU
supprot. NOUVEAU and RADEON platforms also depends on drm_prime_pages_to_sg
helper function.

This set is base on "exynos-drm-fixes" branch at
http://git.kernel.org/?p=linux/kernel/git/daeinki/drm-exynos.git

Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit dca25cb80065849e71e5c95a7fd74b0d67695bf3)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I84057f2c4993e18f391a96193324d6d7234e3e5d
Reviewed-on: https://chromium-review.googlesource.com/190604
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/prime: keep a reference from the handle to exported dma-buf (v6)

Currently we have a problem with this:
1. i915: create gem object
2. i915: export gem object to prime
3. radeon: import gem object
4. close prime fd
5. radeon: unref object
6. i915: unref object

i915 has an imported object reference in its file priv, that isn't
cleaned up properly until fd close. The reference gets added at step 2,
but at step 6 we don't have enough info to clean it up.

The solution is to take a reference on the dma-buf when we export it,
and drop the reference when the gem handle goes away.

So when we export a dma_buf from a gem object, we keep track of it
with the handle, we take a reference to the dma_buf. When we close
the handle (i.e. userspace is finished with the buffer), we drop
the reference to the dma_buf, and it gets collected.

This patch isn't meant to fix any other problem or bikesheds, and it doesn't
fix any races with other scenarios.

v1.1: move export symbol line back up.

v2: okay I had to do a bit more, as the first patch showed a leak
on one of my tests, that I found using the dma-buf debugfs support,
the problem case is exporting a buffer twice with the same handle,
we'd add another export handle for it unnecessarily, however
we now fail if we try to export the same object with a different gem handle,
however I'm not sure if that is a case I want to support, and I've
gotten the code to WARN_ON if we hit something like that.

v2.1: rebase this patch, write better commit msg.
v3: cleanup error handling, track import vs export in linked list,
these two patches were separate previously, but seem to work better
like this.
v4: danvet is correct, this code is no longer useful, since the buffer
better exist, so remove it.
v5: always take a reference to the dma buf object, import or export.
(Imre Deak contributed this originally)
v6: square the circle, remove import vs export tracking now
that there is no difference

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 219b47339ced80ca580bb6ce7d1636166984afa7)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I5065a9481edc22d2ed83c0b3424a3900057a89a9
Reviewed-on: https://chromium-review.googlesource.com/190605
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm: prime: fix refcounting on the dmabuf import error path

In commit be8a42ae60 we inroduced a refcount problem, where on the
drm_gem_prime_fd_to_handle() error path we'll call dma_buf_put() for
self imported dma buffers.

Fix this by taking a reference on the dma buffer in the .gem_import
hook instead of assuming the caller had taken one. Besides fixing the
bug this is also more logical.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 011c2282c74db120f01a8414edc66c3f217f5511)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Conflicts:
	drivers/gpu/drm/i915/i915_gem_dmabuf.c
	drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
[marcheu: fixup extra file from bad cherry-picking]

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I43bb09bec48aa9d1cb93295c9cf89f13d76189ac
Reviewed-on: https://chromium-review.googlesource.com/190606
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/prime: warn for non-empty handle lookup list during drm file release

drm_gem_release should release all handles connected to the drm file and
so should also release the prime lookup entries of these handles. So
just WARN if this isn't the case.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 98b76231d7ef49c71c7fea354f00c619ab2c1be4)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I52eb5c54348adfc41f618c9c2ce24ecfe77e01b7
Reviewed-on: https://chromium-review.googlesource.com/190607
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
dma_buf: Cleanup dma_buf_fd

Remove redundant 'error' variable.

Signed-off-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f5e097f0465e874ac76e8b6ae355b6faa83973a1)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I09d213c5f50d909cebcf938b8390b81df410d81d
Reviewed-on: https://chromium-review.googlesource.com/190608
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
dma-buf: implement vmap refcounting in the interface logic

All drivers which implement this need to have some sort of refcount to
allow concurrent vmap usage. Hence implement this in the dma-buf core.

To protect against concurrent calls we need a lock, which potentially
causes new funny locking inversions. But this shouldn't be a problem
for exporters with statically allocated backing storage, and more
dynamic drivers have decent issues already anyway.

Inspired by some refactoring patches from Aaron Plattner, who
implemented the same idea, but only for drm/prime drivers.

v2: Check in dma_buf_release that no dangling vmaps are left.
Suggested by Aaron Plattner. We might want to do similar checks for
attachments, but that's for another patch. Also fix up ERR_PTR return
for vmap.

v3: Check whether the passed-in vmap address matches with the cached
one for vunmap. Eventually we might want to remove that parameter -
compared to the kmap functions there's no need for the vaddr for
unmapping.  Suggested by Chris Wilson.

v4: Fix a brown-paper-bag bug spotted by Aaron Plattner.

Cc: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Rob Clark <rob@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit f00b4dad9d9eb001a04cf72e8351a2a1b9e99322)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Conflicts:
	include/linux/dma-buf.h

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: Ie56d415c30aa02a3020d78089f9febf7a4b6f450
Reviewed-on: https://chromium-review.googlesource.com/190609
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
dma-buf: replace dma_buf_export() with dma_buf_export_named()

For debugging purposes, it is useful to have a name-string added
while exporting buffers. Hence, dma_buf_export() is replaced with
dma_buf_export_named(), which additionally takes 'exp_name' as a
parameter.

For backward compatibility, and for lazy exporters who don't wish to
name themselves, a #define dma_buf_export() is also made available,
which adds a __FILE__ instead of 'exp_name'.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
  [Thanks for the idea!]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>

(cherry picked from commit 78df969550e7187f4dcd70b737217dcbc8e9a06a)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: Ib87d30c3382f97b932f34c6953b226ac5288f5dc
Reviewed-on: https://chromium-review.googlesource.com/190620
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
dma-buf: Add debugfs support

Add debugfs support to make it easier to print debug information
about the dma-buf buffers.

Cc: Dave Airlie <airlied@redhat.com>
 [minor fixes on init and warning fix]
Cc: Dan Carpenter <dan.carpenter@oracle.com>
 [remove double unlock in fail case]
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>

(cherry picked from commit b89e35636bc75b72d15a1af6d49798802aff77d5)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Conflicts:
	drivers/base/dma-buf.c

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I3b032d8b8cd7f43b3ca2e2742943c41ac641d8df
Reviewed-on: https://chromium-review.googlesource.com/190621
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
[media] dma-buf: Cocci spatch "ptr_ret.spatch"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
(cherry picked from commit 703e60655ca520c5380d8c83a9db0d5e9b906856)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I15f447cbbab7d9f50b4608b225cbe484705bd3b7
Reviewed-on: https://chromium-review.googlesource.com/190622
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
dma-buf: Check return value of anon_inode_getfile

anon_inode_getfile might fail, so check its return value.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit 9022e24e8946400d53719a761815069c3183e2bd)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I7d380790ab379b43e0ab320d8388936c142de74a
Reviewed-on: https://chromium-review.googlesource.com/190623
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
dma-buf: Expose buffer size to userspace (v2)

Each dma-buf has an associated size and it's reasonable for userspace
to want to know what it is.

Since userspace already has an fd, expose the size using the
size = lseek(fd, SEEK_END, 0); lseek(fd, SEEK_CUR, 0);
idiom.

v2: Added Daniel's sugeested documentation, with minor fixups

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit 19e8697ba45e7bcdb04f2adf6110fbf4882863e5)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I6e1437ff611174face4366a2dc6ee25a0d09173a
Reviewed-on: https://chromium-review.googlesource.com/190624
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm: add unpin function to prime helpers

Prevents buffers from being pinned forever.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 102d6dba306c825cd5c310f73868b130931f47aa)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I4872972367612e486f1968cda345500c2f91a9c1
Reviewed-on: https://chromium-review.googlesource.com/190625
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm: move pinning/unpinning to buffer attach

This allows importing bo's to own device to work without requiring that the buffer is pinned in GART.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ca793f75d91d61fd0009c4179eb88aac54a74239)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: Ie7356835daf987b86b3167a7813e6b80f50486e6
Reviewed-on: https://chromium-review.googlesource.com/190626
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/prime: Cocci spatch "err_cast.spatch"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f2a5da4ff2d4085ef5c777cad8a57e083d037809)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: Ib9b2c148047fa87265384a6843d911393963f29c
Reviewed-on: https://chromium-review.googlesource.com/190627
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/prime: Honor requested file flags when exporting a buffer

The DRM PRIME API passes file flags to the driver for the exported
buffer. Honor them instead of hardcoding 0600.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ebc0bad4a05ad63979e8bc115cea3b8abdf814c7)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Conflicts:
	drivers/gpu/drm/drm_prime.c

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I43267d705beefaf7084f8d8340e9fa865756a435
Reviewed-on: https://chromium-review.googlesource.com/190628
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/prime: fix to check return of dma_map_sg in prime helper

The dma_map_sg(), in map_dma_buf callback operation of prime helper,
can return 0 when it fails to map, so it needs to release related
resources.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b720d54a5caf077011f0dc6ba7792866d2828d16)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I3278a74f1f1ec9fbd7162eb8e6c540941c1c2f76
Reviewed-on: https://chromium-review.googlesource.com/190629
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
drm/prime: replace NULL with error value in drm_prime_pages_to_sg

Instead of NULL, error value is casted with ERR_PTR() for
drm_prime_pages_to_sg() and IS_ERR_OR_NULL() macro is replaced
with IS_ERR() macro for drm_gem_map_dma_buf().

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 7e3d88f9cce3ea3350fa25b89393a6dd2b8e5ed4)
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

BUG=chromium:340541
TEST=builds and runs on link and daisy

Change-Id: I1124f4ab61accbabe431c660d9ecb902c26980cc
Reviewed-on: https://chromium-review.googlesource.com/190630
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>