Basic 3D operation demonstrator

Tom De Man Tom.DeMan at DZINE.BE
Wed Jun 6 01:37:12 PDT 2007


Hi,

I'm still struggling to put anything in 3D on screen in another OS using
only OUT_RING commands, nothing appears and I can't figure out why.

2D operation works fine if I do this, so video mode programming and the
display offset in the frame buffer (dst_offset) are OK:

    //Do a 2D test first: WHITE rectangle(0,0,300,300)
    {
        BEGIN_LP_RING(6); //) in i915_emit_cmds

        OUT_RING(XY_COLOR_BLT_CMD|XY_COLOR_BLT_WRITE_RGB); 
        OUT_RING(dst_pitch |((0xFF) << 16)|1<<24|1<<25); //3f01000
        OUT_RING(0); //0
        OUT_RING((300 << 16) | 300); //12c012c
        OUT_RING(dst_offset);
        OUT_RING(0xffffff); //ffffff

        ADVANCE_LP_RING();
    }

But I've tried lots of things to get something 3D (like a 3D rectangle) on
screen but nothing appears.

For example, I took this part from the i915_video.c (and testing it on the
915) but no rect on screen:

        BEGIN_LP_RING(vert_data_count + 8);
        OUT_RING(MI_NOOP);
        OUT_RING(MI_NOOP);
        OUT_RING(MI_NOOP);
        OUT_RING(MI_NOOP);
        OUT_RING(MI_NOOP);
        OUT_RING(MI_NOOP);
        OUT_RING(MI_NOOP);

        // vertex data - rect list consists of bottom right, bottom left,
and top
        // left vertices.

        OUT_RING(PRIM3D_INLINE | PRIM3D_RECTLIST |
            (vert_data_count - 1));

        // bottom right
        OUT_RING_F(box_x2 + pix_xoff);
        OUT_RING_F(box_y2 + pix_yoff);
        if (!planar) {
            OUT_RING_F((box_x2 - dxo) * src_scale_x);
            OUT_RING_F((box_y2 - dyo) * src_scale_y);
        } else {
            OUT_RING_F((box_x2 - dxo) * src_scale_x / 2.0);
            OUT_RING_F((box_y2 - dyo) * src_scale_y / 2.0);
            OUT_RING_F((box_x2 - dxo) * src_scale_x);
            OUT_RING_F((box_y2 - dyo) * src_scale_y);
        }

        // bottom left
        OUT_RING_F(box_x1 + pix_xoff);
        OUT_RING_F(box_y2 + pix_yoff);
        if (!planar) {
            OUT_RING_F((box_x1 - dxo) * src_scale_x);
            OUT_RING_F((box_y2 - dyo) * src_scale_y);
        } else {
            OUT_RING_F((box_x1 - dxo) * src_scale_x / 2.0);
            OUT_RING_F((box_y2 - dyo) * src_scale_y / 2.0);
            OUT_RING_F((box_x1 - dxo) * src_scale_x);
            OUT_RING_F((box_y2 - dyo) * src_scale_y);
        }

        // top left
        OUT_RING_F(box_x1 + pix_xoff);
        OUT_RING_F(box_y1 + pix_yoff);
        if (!planar) {
            OUT_RING_F((box_x1 - dxo) * src_scale_x);
            OUT_RING_F((box_y1 - dyo) * src_scale_y);
        } else {
            OUT_RING_F((box_x1 - dxo) * src_scale_x / 2.0);
            OUT_RING_F((box_y1 - dyo) * src_scale_y / 2.0);
            OUT_RING_F((box_x1 - dxo) * src_scale_x);
            OUT_RING_F((box_y1 - dyo) * src_scale_y);
        }

        ADVANCE_LP_RING();


The variables are all fine in there I think (seem like good values) but I
think the problem is I have to do more things to prepare the 3D engine I
don't know about. I tried adding the code from i915_emit_invarient_state()
from i915_vtbl.c before it but nothing either. 

What am I missing here ?

Kind regards,
Tom



--------------------------------------------------------------------------
Confidentiality Statement: This e-mail is intended solely for the person to whom it is addressed and may contain confidential or legally privileged information. Access to this e-mail by anyone else is unauthorised. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and destroy this e-mail and any attachments. Any views or opinions presented are solely those of the author and do not necessarily represent those of dZine n.v. E-mail may be susceptible to data corruption, interception, unauthorised amendment, viruses and delays or the consequences thereof. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited.
--------------------------------------------------------------------------



More information about the xorg mailing list