summaryrefslogtreecommitdiff
path: root/clip_rectangle.c
blob: b5a0db9dfdfaecc7e813e38595a4e754d9f8fc9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdint.h>
#include "nouveau_class.h"
#include <nouveau_pushbuf.h>
#include <nouveau_notifier.h>

#include "screen.h"
#include "object.h"
#include "fifo.h"

void clip_rectangle_init(void)
{
	struct nouveau_grobj *subchClipRect = grobj[NvSubClipRect];

	printf("-- Clip rectangle, init\n");

	BEGIN_RING(chan, subchClipRect, NV01_CONTEXT_CLIP_RECTANGLE_DMA_NOTIFY, 1);
	OUT_RING  (chan, notifier->handle);

	BEGIN_RING(chan, subchClipRect, NV01_CONTEXT_CLIP_RECTANGLE_POINT, 2);
	OUT_RING  (chan, (viewport_y<<16) | viewport_x);
	OUT_RING  (chan, (viewport_h<<16) | viewport_w);

	FIRE_RING(chan);
}