OSDN Git Service

Use drm gem acess userdata IOCTL for set/get interlace
[android-x86/external-minigbm.git] / cros_gralloc / gralloc1 / cros_gralloc1_module.cc
index d9136fa..f0b3f04 100644 (file)
@@ -221,10 +221,12 @@ gralloc1_function_pointer_t CrosGralloc1::doGetFunction(int32_t intDescriptor)
                return asFP<GRALLOC1_PFN_UNLOCK>(unlockHook);
        case GRALLOC1_FUNCTION_SET_MODIFIER:
                return asFP<GRALLOC1_PFN_SET_MODIFIER>(setModifierHook);
-        case GRALLOC1_FUNCTION_SET_INTERLACE:
-                return asFP<GRALLOC1_PFN_SET_INTERLACE>(setInterlaceHook);
-        case GRALLOC1_FUNCTION_SET_PROTECTIONINFO:
-                return asFP<GRALLOC1_PFN_SET_PROTECTIONINFO>(setProtectionInfoHook);
+       case GRALLOC1_FUNCTION_SET_INTERLACE:
+               return asFP<GRALLOC1_PFN_SET_INTERLACE>(setInterlaceHook);
+       case GRALLOC1_FUNCTION_GET_INTERLACE:
+               return asFP<GRALLOC1_PFN_GET_INTERLACE>(getInterlaceHook);
+       case GRALLOC1_FUNCTION_SET_PROTECTIONINFO:
+               return asFP<GRALLOC1_PFN_SET_PROTECTIONINFO>(setProtectionInfoHook);
        case GRALLOC1_FUNCTION_INVALID:
                ALOGE("Invalid function descriptor");
                return nullptr;
@@ -290,11 +292,19 @@ int32_t CrosGralloc1::setFormat(gralloc1_buffer_descriptor_t descriptorId, int32
 int32_t CrosGralloc1::setInterlace(buffer_handle_t buffer, uint32_t interlace)
 {
         auto hnd = (cros_gralloc_handle*) cros_gralloc_convert_handle(buffer);
-        if (!hnd) {
-                return CROS_GRALLOC_ERROR_BAD_HANDLE;
-        }
-        hnd->is_interlaced = interlace;
-        return CROS_GRALLOC_ERROR_NONE;
+       if (!hnd) {
+               return CROS_GRALLOC_ERROR_BAD_HANDLE;
+       }
+       return driver->setinterlace(buffer, interlace);
+}
+
+int32_t CrosGralloc1::getInterlace(buffer_handle_t buffer, uint32_t *interlace)
+{
+       auto hnd = (cros_gralloc_handle *)cros_gralloc_convert_handle(buffer);
+       if (!hnd) {
+               return CROS_GRALLOC_ERROR_BAD_HANDLE;
+       }
+       return driver->getinterlace(buffer, interlace);
 }
 
 int32_t CrosGralloc1::setProtectionInfo(buffer_handle_t buffer, uint32_t protection_info)