mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1211 from kwagyeman/kwabena/fb_alloc_cleanup
Cleanup FB_ALLOC_OVERLAY pointers
This commit is contained in:
commit
afb8f9e47d
@ -28,8 +28,8 @@ static uint32_t alloc_bytes_peak;
|
|||||||
|
|
||||||
#if defined(OMV_FB_OVERLAY_MEMORY)
|
#if defined(OMV_FB_OVERLAY_MEMORY)
|
||||||
#define FB_OVERLAY_MEMORY_FLAG 0x1
|
#define FB_OVERLAY_MEMORY_FLAG 0x1
|
||||||
extern char _fballoc_overlay;
|
extern char _fballoc_overlay_end, _fballoc_overlay_start;
|
||||||
static char *pointer_overlay = &_fballoc_overlay;
|
static char *pointer_overlay = &_fballoc_overlay_end;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// fb_alloc_free_till_mark() will not free past this.
|
// fb_alloc_free_till_mark() will not free past this.
|
||||||
@ -57,7 +57,7 @@ void fb_alloc_init0()
|
|||||||
{
|
{
|
||||||
pointer = &_fballoc;
|
pointer = &_fballoc;
|
||||||
#if defined(OMV_FB_OVERLAY_MEMORY)
|
#if defined(OMV_FB_OVERLAY_MEMORY)
|
||||||
pointer_overlay = &_fballoc_overlay;
|
pointer_overlay = &_fballoc_overlay_end;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ void *fb_alloc(uint32_t size, int hints)
|
|||||||
|
|
||||||
#if defined(OMV_FB_OVERLAY_MEMORY)
|
#if defined(OMV_FB_OVERLAY_MEMORY)
|
||||||
if ((!(hints & FB_ALLOC_PREFER_SIZE))
|
if ((!(hints & FB_ALLOC_PREFER_SIZE))
|
||||||
&& (((uint32_t) (pointer_overlay - OMV_FB_OVERLAY_MEMORY_ORIGIN)) >= size)) {
|
&& (((uint32_t) (pointer_overlay - &_fballoc_overlay_start)) >= size)) {
|
||||||
// Return overlay memory instead.
|
// Return overlay memory instead.
|
||||||
pointer_overlay -= size;
|
pointer_overlay -= size;
|
||||||
result = pointer_overlay;
|
result = pointer_overlay;
|
||||||
@ -204,7 +204,7 @@ void *fb_alloc_all(uint32_t *size, int hints)
|
|||||||
|
|
||||||
#if defined(OMV_FB_OVERLAY_MEMORY)
|
#if defined(OMV_FB_OVERLAY_MEMORY)
|
||||||
if (!(hints & FB_ALLOC_PREFER_SIZE)) {
|
if (!(hints & FB_ALLOC_PREFER_SIZE)) {
|
||||||
*size = (uint32_t) (pointer_overlay - OMV_FB_OVERLAY_MEMORY_ORIGIN);
|
*size = (uint32_t) (pointer_overlay - &_fballoc_overlay_start);
|
||||||
temp = IM_MIN(temp, *size);
|
temp = IM_MIN(temp, *size);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -179,7 +179,6 @@
|
|||||||
#define OMV_AXI_SRAM_LENGTH 512K
|
#define OMV_AXI_SRAM_LENGTH 512K
|
||||||
#define OMV_DRAM_ORIGIN 0xC0000000
|
#define OMV_DRAM_ORIGIN 0xC0000000
|
||||||
#define OMV_DRAM_LENGTH 32M
|
#define OMV_DRAM_LENGTH 32M
|
||||||
#define OMV_FB_OVERLAY_MEMORY_ORIGIN OMV_AXI_SRAM_ORIGIN
|
|
||||||
|
|
||||||
// Domain 1 DMA buffers region.
|
// Domain 1 DMA buffers region.
|
||||||
#define OMV_DMA_MEMORY_D1 AXI_SRAM
|
#define OMV_DMA_MEMORY_D1 AXI_SRAM
|
||||||
|
|||||||
@ -176,7 +176,6 @@
|
|||||||
#define OMV_AXI_SRAM_LENGTH 512K
|
#define OMV_AXI_SRAM_LENGTH 512K
|
||||||
#define OMV_DRAM_ORIGIN 0xC0000000
|
#define OMV_DRAM_ORIGIN 0xC0000000
|
||||||
#define OMV_DRAM_LENGTH 64M
|
#define OMV_DRAM_LENGTH 64M
|
||||||
#define OMV_FB_OVERLAY_MEMORY_ORIGIN OMV_AXI_SRAM_ORIGIN
|
|
||||||
|
|
||||||
// Domain 1 DMA buffers region.
|
// Domain 1 DMA buffers region.
|
||||||
#define OMV_DMA_MEMORY_D1 AXI_SRAM
|
#define OMV_DMA_MEMORY_D1 AXI_SRAM
|
||||||
|
|||||||
@ -179,7 +179,6 @@
|
|||||||
#define OMV_DRAM_LENGTH 8M
|
#define OMV_DRAM_LENGTH 8M
|
||||||
#define OMV_FLASH_EXT_ORIGIN 0x90000000
|
#define OMV_FLASH_EXT_ORIGIN 0x90000000
|
||||||
#define OMV_FLASH_EXT_LENGTH 16M
|
#define OMV_FLASH_EXT_LENGTH 16M
|
||||||
#define OMV_FB_OVERLAY_MEMORY_ORIGIN OMV_AXI_SRAM_ORIGIN
|
|
||||||
|
|
||||||
// Domain 1 DMA buffers region.
|
// Domain 1 DMA buffers region.
|
||||||
#define OMV_DMA_MEMORY_D1 AXI_SRAM
|
#define OMV_DMA_MEMORY_D1 AXI_SRAM
|
||||||
|
|||||||
@ -126,7 +126,6 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_fballoc_overlay_start = .;
|
_fballoc_overlay_start = .;
|
||||||
. = . + OMV_FB_OVERLAY_MEMORY_OFFSET;
|
. = . + OMV_FB_OVERLAY_MEMORY_OFFSET;
|
||||||
_fballoc_overlay = .;
|
|
||||||
_fballoc_overlay_end = .;
|
_fballoc_overlay_end = .;
|
||||||
} >OMV_FB_OVERLAY_MEMORY
|
} >OMV_FB_OVERLAY_MEMORY
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -107,7 +107,6 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_fballoc_overlay_start = .;
|
_fballoc_overlay_start = .;
|
||||||
. = . + OMV_FB_OVERLAY_MEMORY_OFFSET;
|
. = . + OMV_FB_OVERLAY_MEMORY_OFFSET;
|
||||||
_fballoc_overlay = .;
|
|
||||||
_fballoc_overlay_end = .;
|
_fballoc_overlay_end = .;
|
||||||
} >OMV_FB_OVERLAY_MEMORY
|
} >OMV_FB_OVERLAY_MEMORY
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user