Some work in progress:

* set_gtt_entry() used the wrong index to fill the GTT - this could have never
  worked correctly when you specified more memory than the amount of stolen
  memory.
* Implementing maintaining resources for emulating overlay using the 3D engine
  on i965. I don't yet commit the actual overlay code, as that is a) ugly, and
  b) does not work yet.
* Moved AreaKeeper into its own header.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23709 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-01-23 17:50:27 +00:00
parent 53a1a99de7
commit 4dfa9e425f
8 changed files with 152 additions and 103 deletions
@@ -0,0 +1,73 @@
/*
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler, [email protected]
*/
#ifndef AREA_KEEPER_H
#define AREA_KEEPER_H
#include <KernelExport.h>
#include <OS.h>
class AreaKeeper {
public:
AreaKeeper();
~AreaKeeper();
area_id Create(const char *name, void **_virtualAddress, uint32 spec,
size_t size, uint32 lock, uint32 protection);
area_id Map(const char *name, void *physicalAddress, size_t numBytes,
uint32 spec, uint32 protection, void **_virtualAddress);
status_t InitCheck() { return fArea < B_OK ? (status_t)fArea : B_OK; }
void Detach();
private:
area_id fArea;
};
AreaKeeper::AreaKeeper()
:
fArea(-1)
{
}
AreaKeeper::~AreaKeeper()
{
if (fArea >= B_OK)
delete_area(fArea);
}
area_id
AreaKeeper::Create(const char *name, void **_virtualAddress, uint32 spec,
size_t size, uint32 lock, uint32 protection)
{
fArea = create_area(name, _virtualAddress, spec, size, lock, protection);
return fArea;
}
area_id
AreaKeeper::Map(const char *name, void *physicalAddress, size_t numBytes,
uint32 spec, uint32 protection, void **_virtualAddress)
{
fArea = map_physical_memory(name, physicalAddress, numBytes, spec, protection,
_virtualAddress);
return fArea;
}
void
AreaKeeper::Detach()
{
fArea = -1;
}
#endif // AREA_KEEPER_H
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -179,6 +179,7 @@ struct intel_free_graphics_memory {
#define G33_GTT_2M (2 << 8)
#define GTT_ENTRY_VALID 0x01
#define GTT_ENTRY_LOCAL_MEMORY 0x02
#define GTT_PAGE_SHIFT 12
// interrupts
#define INTEL_INTERRUPT_ENABLED 0x020a0