graphicscompositionref/surfacemgrcommon/inc/syborgvirtualhwmemory.h
author Gareth Stockwell <gareth.stockwell@accenture.com>
Fri, 24 Sep 2010 13:54:59 +0100
branchbug235_bringup_0
changeset 2 47632b7dfb88
parent 0 91fe342bd9c4
permissions -rw-r--r--
Refactoring of frame buffer references to surface buffer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     7
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    10
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    11
// Contributors:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    12
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    13
// Description:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    14
// Syborg Virtual Hardware Memory implementation
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    15
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    16
/**
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    17
 @file
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    18
 @internalTechnology
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    19
 @prototype
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    20
*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    21
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    22
#ifndef __SYBORGVIRTUALHWMEMORY_H__
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    23
#define __SYBORGVIRTUALHWMEMORY_H__
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    24
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    25
#include <klib.h>
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    26
#include <graphics/virtualvideohwinterface.h>
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    27
#include <graphics/guestvideodriverinterfaceconstants.h>
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    28
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    29
/**
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    30
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    31
Very simple memory manager for platsim virtual HW memory
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    32
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    33
*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    34
class DVirtualHWMemoryManager: public DBase
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    35
    {
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    36
    struct TAllocatedCell
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    37
        {
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    38
        TAllocatedCell( TInt aSize, TUint32 aBase ):
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    39
            iSize( aSize ),
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    40
            iBase( aBase ),
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    41
            iNext( NULL )
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    42
            {
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    43
            }
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    44
        
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    45
        TInt iSize;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    46
        TUint32 iBase;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    47
        TAllocatedCell* iNext;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    48
        };
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    49
    
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    50
public:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    51
    DVirtualHWMemoryManager(TUint32 aBase, TInt aMaxSize);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    52
    
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    53
    TUint32 Allocate(TInt aSize);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    54
    
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    55
    void Deallocate(const TUint32 aPhysicalAddress);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    56
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    57
    ~DVirtualHWMemoryManager();
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    58
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    59
private:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    60
    TAllocatedCell iRoot;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    61
    TAllocatedCell iLast;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    62
    };
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    63
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    64
#endif