32 files changed, 2617 insertions, 874 deletions
diff --git a/hwc2/common/composers/GE2DComposer.h b/hwc2/common/composers/GE2DComposer.h index c71c115..7dbff5c 100644 --- a/hwc2/common/composers/GE2DComposer.h +++ b/hwc2/common/composers/GE2DComposer.h @@ -1,5 +1,18 @@ /* -// Copyright(c) 2016 Amlogic Corporation +// Copyright (c) 2016 Amlogic +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// */ #ifndef GE2D_COMPOSER_H @@ -43,8 +56,11 @@ public: mDisplayFrame = hwcLayer->getDisplayFrame(); mBufferHnd = hwcLayer->getBufferHandle(); - private_handle_t const* hnd = reinterpret_cast<private_handle_t const*>(mBufferHnd); - mBufferFd = Utils::checkAndDupFd(hnd->ion_hnd); + private_handle_t const* hnd = private_handle_t::dynamicCast(mBufferHnd); + if (hnd) + mBufferFd = Utils::checkAndDupFd(hnd->ion_hnd); + else + mBufferFd = -1; } int32_t mBlendMode; |