mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 17:50:39 +02:00
nouveauCreateDmaObject
This commit is contained in:
parent
fb65450704
commit
a75440bcf0
3 changed files with 36 additions and 4 deletions
|
|
@ -45,6 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "nouveau_object.h"
|
||||
#include "nouveau_fifo.h"
|
||||
#include "nouveau_tex.h"
|
||||
#include "nouveau_msg.h"
|
||||
#include "nv10_swtcl.h"
|
||||
|
||||
#include "vblank.h"
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
#include "nouveau_object.h"
|
||||
|
||||
|
||||
static GLboolean NVDmaCreateContextObject(nouveauContextPtr nmesa, int handle, int class, uint32_t flags,
|
||||
uint32_t dma_in, uint32_t dma_out, uint32_t dma_notifier)
|
||||
static GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa, int handle, int class, uint32_t flags, uint32_t dma_in, uint32_t dma_out, uint32_t dma_notifier)
|
||||
{
|
||||
drm_nouveau_object_init_t cto;
|
||||
int ret;
|
||||
|
|
@ -20,7 +19,27 @@ static GLboolean NVDmaCreateContextObject(nouveauContextPtr nmesa, int handle, i
|
|||
return ret == 0;
|
||||
}
|
||||
|
||||
static void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int handle, int subchannel)
|
||||
static GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
|
||||
uint32_t handle,
|
||||
uint32_t offset,
|
||||
uint32_t size,
|
||||
int target,
|
||||
int access)
|
||||
{
|
||||
drm_nouveau_dma_object_init_t dma;
|
||||
int ret;
|
||||
|
||||
dma.handle = handle;
|
||||
dma.target = target;
|
||||
dma.access = access;
|
||||
dma.offset = offset;
|
||||
dma.handle = handle;
|
||||
ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_DMA_OBJECT_INIT,
|
||||
&dma, sizeof(dma));
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle)
|
||||
{
|
||||
BEGIN_RING_SIZE(subchannel, 0, 1);
|
||||
OUT_RING(handle);
|
||||
|
|
@ -28,8 +47,18 @@ static void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int handle, int s
|
|||
|
||||
void nouveauObjectInit(nouveauContextPtr nmesa)
|
||||
{
|
||||
NVDmaCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d, 0, 0, 0, 0);
|
||||
#ifdef NOUVEAU_RING_DEBUG
|
||||
return;
|
||||
#endif
|
||||
|
||||
nouveauCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d, 0, 0, 0, 0);
|
||||
nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
|
||||
/* We need to know vram size.. */
|
||||
#if 0
|
||||
nouveauCreateDmaObject( nmesa, NvDmaFB,
|
||||
0, (256*1024*1024),
|
||||
0 /*NV_DMA_TARGET_FB*/, 0 /*NV_DMA_ACCESS_RW*/);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@ void nouveauObjectInit(nouveauContextPtr nmesa);
|
|||
|
||||
enum DMAObjects {
|
||||
Nv3D = 0x80000019,
|
||||
NvDmaFB = 0xD0FB0001
|
||||
};
|
||||
|
||||
enum DMASubchannel {
|
||||
NvSub3D = 7,
|
||||
};
|
||||
|
||||
extern void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue