Browse files

allocate a new bit in the rom type detection sysctl to use different …

…mali driver in samsung 4.1 and 4.2 roms
  • Loading branch information...
1 parent 7543f14 commit a6e6da0cb3eeb8438de13cda65f6cfc96475bfb4 @gokhanmoral committed Apr 1, 2013
View
2 drivers/media/video/samsung/ump/linux/ump_kernel_linux.c
@@ -451,7 +451,7 @@ static int ump_file_mmap(struct file * filp, struct vm_area_struct * vma)
DBG_MSG(3, ("UMP Map function: Forcing the CPU to use cache\n"));
}
/* By setting this flag, during a process fork; the child process will not have the parent UMP mappings */
- AOSPROM vma->vm_flags |= VM_DONTCOPY;
+ if(!OLDMALIEXPR) vma->vm_flags |= VM_DONTCOPY;
DBG_MSG(4, ("UMP vma->flags: %x\n", vma->vm_flags ));
View
4 drivers/media/video/samsung/ump/linux/ump_kernel_memory_backend_os.c
@@ -142,13 +142,13 @@ static int os_allocate(void* ctx, ump_dd_mem * descriptor)
if (is_cached)
{
-SAMSUNGROM
+OLDMALI
new_page = alloc_page(GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN);
else
new_page = alloc_page(GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY | __GFP_NOWARN );
} else
{
-SAMSUNGROM
+OLDMALI
new_page = alloc_page(GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN | __GFP_COLD);
else
new_page = alloc_page(GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY | __GFP_NOWARN | __GFP_COLD);
View
3 include/linux/kernel.h
@@ -756,9 +756,12 @@ extern char *mach_panic_string;
#define FEATURE_BIT_ROM 0 //0:Samsung 1:AOSP(CM7|MIUI|Others)
#define FEATURE_BIT_AOSP_TYPE 1 //1-CM7 0-OtherAOSP|MIUI
+#define FEATURE_BIT_MALI 2 //1-new mali 0-old mali
+#define OLDMALIEXPR ((rom_feature_set & (1<<FEATURE_BIT_MALI) ) == 0)
#define SAMSUNGROMEXPR ((rom_feature_set & (1<<FEATURE_BIT_ROM) ) == 0)
#define SAMSUNGROM if( SAMSUNGROMEXPR )
+#define OLDMALI if( OLDMALIEXPR )
#define AOSPROM if( (rom_feature_set & (1<<FEATURE_BIT_ROM) )== (1<<FEATURE_BIT_ROM) )
#define CYANOGENMOD if( (rom_feature_set & (1<<FEATURE_BIT_AOSP_TYPE) ) == (1<<FEATURE_BIT_AOSP_TYPE) )
//more to come...
View
2 kernel/sysctl.c
@@ -262,7 +262,7 @@ rom_feature_set_sysctl(struct ctl_table *table, int write,
printk("Initializing USB with rom_feature_set: %d\n", rom_feature_set);
late_init_android_gadget(rom_feature_set);
#ifdef CONFIG_MALI_CM
- if(rom_feature_set == 3) new_late_mali_driver_init();
+ if(!OLDMALIEXPR) new_late_mali_driver_init();
else late_mali_driver_init();
#else
late_mali_driver_init();

0 comments on commit a6e6da0

Please sign in to comment.