/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2017 The Android Open Source Project
 *
 * 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 __QTIQMAACOMPOSERHANDLEIMPORTER_H__
#define __QTIQMAACOMPOSERHANDLEIMPORTER_H__

#include <android/hardware/graphics/mapper/2.0/IMapper.h>
#include <android/hardware/graphics/mapper/3.0/IMapper.h>
#include <utils/Mutex.h>

namespace vendor {
namespace qti {
namespace hardware {
namespace display {
namespace composer {
namespace V3_0 {

using IMapperV2 = ::android::hardware::graphics::mapper::V2_0::IMapper;
using IMapperV3 = ::android::hardware::graphics::mapper::V3_0::IMapper;
using ::android::Mutex;
using ::android::sp;
using ::android::hardware::hidl_handle;

class ComposerHandleImporter {
 public:
  ComposerHandleImporter();

  // In IComposer, any buffer_handle_t is owned by the caller and we need to
  // make a clone for hwcomposer2.  We also need to translate empty handle
  // to nullptr.  This function does that, in-place.
  bool importBuffer(buffer_handle_t &handle);
  void freeBuffer(buffer_handle_t handle);
  void initialize();
  void cleanup();

 private:
  Mutex mLock;
  bool mInitialized = false;
  sp<IMapperV2> mMapper_V2;
  sp<IMapperV3> mMapper_V3;
};

}  // namespace V3_0
}  // namespace composer
}  // namespace display
}  // namespace hardware
}  // namespace qti
}  // namespace vendor

#endif  // __QTIQMAACOMPOSERHANDLEIMPORTER_H__
