am 87ea1dfa: fix[2222341] Soft reset while going back from camcorder settings
Merge commit '87ea1dfa60cf130fafdbab8e94cb2ce9ff8d0975' into eclair-mr2 * commit '87ea1dfa60cf130fafdbab8e94cb2ce9ff8d0975': fix[2222341] Soft reset while going back from camcorder settings
This commit is contained in:
		@@ -77,6 +77,9 @@ extern int gralloc_register_buffer(gralloc_module_t const* module,
 | 
			
		||||
extern int gralloc_unregister_buffer(gralloc_module_t const* module,
 | 
			
		||||
        buffer_handle_t handle);
 | 
			
		||||
 | 
			
		||||
extern int gralloc_perform(struct gralloc_module_t const* module,
 | 
			
		||||
        int operation, ... );
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
 | 
			
		||||
static struct hw_module_methods_t gralloc_module_methods = {
 | 
			
		||||
@@ -98,6 +101,7 @@ struct private_module_t HAL_MODULE_INFO_SYM = {
 | 
			
		||||
        unregisterBuffer: gralloc_unregister_buffer,
 | 
			
		||||
        lock: gralloc_lock,
 | 
			
		||||
        unlock: gralloc_unlock,
 | 
			
		||||
        perform: gralloc_perform,
 | 
			
		||||
    },
 | 
			
		||||
    framebuffer: 0,
 | 
			
		||||
    flags: 0,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										36
									
								
								mapper.cpp
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								mapper.cpp
									
									
									
									
									
								
							@@ -19,6 +19,7 @@
 | 
			
		||||
#include <pthread.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
 | 
			
		||||
#include <sys/mman.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
@@ -284,3 +285,38 @@ int gralloc_unlock(gralloc_module_t const* module,
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
 | 
			
		||||
int gralloc_perform(struct gralloc_module_t const* module,
 | 
			
		||||
        int operation, ... )
 | 
			
		||||
{
 | 
			
		||||
    int res = -EINVAL;
 | 
			
		||||
    va_list args;
 | 
			
		||||
    va_start(args, operation);
 | 
			
		||||
 | 
			
		||||
    switch (operation) {
 | 
			
		||||
        case GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER: {
 | 
			
		||||
            int fd = va_arg(args, int);
 | 
			
		||||
            size_t size = va_arg(args, size_t);
 | 
			
		||||
            size_t offset = va_arg(args, size_t);
 | 
			
		||||
            void* base = va_arg(args, void*);
 | 
			
		||||
            native_handle_t** handle = va_arg(args, native_handle_t**);
 | 
			
		||||
            private_handle_t* hnd = (private_handle_t*)native_handle_create(
 | 
			
		||||
                    private_handle_t::sNumFds, private_handle_t::sNumInts);
 | 
			
		||||
            hnd->magic = private_handle_t::sMagic;
 | 
			
		||||
            hnd->fd = fd;
 | 
			
		||||
            hnd->flags = private_handle_t::PRIV_FLAGS_USES_PMEM;
 | 
			
		||||
            hnd->size = size;
 | 
			
		||||
            hnd->offset = offset;
 | 
			
		||||
            hnd->base = intptr_t(base) + offset;
 | 
			
		||||
            hnd->lockState = private_handle_t::LOCK_STATE_MAPPED;
 | 
			
		||||
            *handle = (native_handle_t *)hnd;
 | 
			
		||||
            res = 0;
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    va_end(args);
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user