[RFC,libdrm 2/3] tegra: Add 2d library

Mark Zhang nvmarkzhang at gmail.com
Thu Dec 27 22:48:59 PST 2012


I just skimmed the code of libdrm while I'm trying to understand the
host1x driver. So below is what I found.

Mark
On 12/13/2012 10:01 PM, Arto Meriläinen wrote:
> From: Francis Hart <fhart at nvidia.com>
> 
> This patch introduces a simple 2d library on top of stream library.
> 
> Signed-off-by: Francis Hart <fhart at nvidia.com>
[...]
> +void
> +g2fill_dispatch(const struct tegra_2d_g2fill *hw,
> +                struct tegra_stream *stream)
> +{
> +    ASSERT(hw);
> +    ASSERT(hw->is_valid);
> +    ASSERT(stream);
> +
> +    tegra_stream_push_setclass(stream, NV_GRAPHICS_2D_CLASS_ID);

I think at the end of the "tegra_stream_begin", we already pushed a
setclass opcode into the stream's active buffer.
So why we need another one here?

> +
> +    tegra_stream_push_words(stream,
> +                            &hw->block,
> +                            sizeof(hw->block) / sizeof(uint32_t),
> +                            1,
> +                            tegra_reloc(&hw->block.dstba,
> +                                        hw->dst_handle,
> +                                        hw->dst_offset));
> +}
> +
[...]
> +#endif // TEGRA_2D_H
> 


More information about the dri-devel mailing list