John Ye | 1503c6b | 2015-01-22 13:26:33 +0800 | [diff] [blame] | 1 | /* |
| 2 | * drm_v4l2_buffer.cpp - drm buffer |
| 3 | * |
| 4 | * Copyright (c) 2015 Intel Corporation |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | * |
| 18 | * Author: Wind Yuan <feng.yuan@intel.com> |
| 19 | * Author: John Ye <john.ye@intel.com> |
| 20 | */ |
| 21 | |
| 22 | #include "drm_v4l2_buffer.h" |
| 23 | |
| 24 | namespace XCam { |
| 25 | |
| 26 | DrmV4l2Buffer::~DrmV4l2Buffer () |
| 27 | { |
Wind Yuan | 25aed2b | 2015-02-10 17:46:23 +0800 | [diff] [blame] | 28 | XCAM_ASSERT (_display.ptr()); |
John Ye | 1503c6b | 2015-01-22 13:26:33 +0800 | [diff] [blame] | 29 | int handle = _display->get_drm_handle (); |
| 30 | if (handle > 0) { |
| 31 | struct drm_mode_destroy_dumb gem; |
Wind Yuan | 2f9c6c5 | 2015-04-30 16:53:28 +0800 | [diff] [blame] | 32 | xcam_mem_clear (gem); |
John Ye | 1503c6b | 2015-01-22 13:26:33 +0800 | [diff] [blame] | 33 | gem.handle = _gem_handle; |
| 34 | xcam_device_ioctl (handle, DRM_IOCTL_MODE_DESTROY_DUMB, &gem); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | }; |