Commit 865d5d29 authored by David Reveman's avatar David Reveman Committed by Commit Bot

Revert "gpu: Fix FD leak when importing DMA-bufs with multiple FDs."

This reverts commit c3dec2b9.

Reason for revert: Last version of patch broke ARC++ import of all buffers

Original change's description:
> gpu: Fix FD leak when importing DMA-bufs with multiple FDs.
> 
> CreateFromHandle is expected to take ownership of all FDs so
> when passed multiple FDs we need to make sure they are closed
> if not used.
>     
> BUG=b/63409814
> TEST=exo_unittests --gtest_also_run_disabled_tests --gtest_filter=DisplayTest.DISABLED_CreateLinuxDMABufBuffer
> 
> Change-Id: I2a8a7b0149a08f08890a725c6ce9aff8aeaab97f
> Reviewed-on: https://chromium-review.googlesource.com/566879
> Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
> Commit-Queue: David Reveman <reveman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#485761}

TBR=reveman@chromium.org,dcastagna@chromium.org

Change-Id: Idad3a18398c1c1ce959bff646f83d607b9e3c2c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/63409814
Reviewed-on: https://chromium-review.googlesource.com/566863Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Commit-Queue: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485884}
parent 5965c6e6
......@@ -62,14 +62,11 @@ GpuMemoryBufferImplNativePixmap::CreateFromHandle(
PLOG(ERROR) << "dup";
return nullptr;
}
// Close all the fds.
for (const auto& fd : handle.native_pixmap_handle.fds)
base::ScopedFD scoped_fd(fd.fd);
}
gfx::NativePixmapHandle native_pixmap_handle;
if (scoped_fd.is_valid()) {
native_pixmap_handle.fds.emplace_back(scoped_fd.release(),
native_pixmap_handle.fds.emplace_back(handle.native_pixmap_handle.fds[0].fd,
true /* auto_close */);
}
native_pixmap_handle.planes = handle.native_pixmap_handle.planes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment