[Mesa-dev] [PATCH 4/4] radeon: Determine the bo priority (MSAA, depth, UVD are high)

Lauri Kasanen cand at gmx.com
Thu Jan 2 00:56:45 PST 2014


On Thu, 02 Jan 2014 05:57:46 +0100
Andreas Hartmetz <ahartmetz at gmail.com> wrote:

> On Wednesday 01 January 2014 16:58:46 Lauri Kasanen wrote:
> > @@ -257,6 +258,7 @@ struct radeon_winsys {
> >                                         unsigned size,
> >                                         unsigned alignment,
> >                                         boolean use_reusable_pool,
> > +                                       boolean high_prio,
> >                                         enum radeon_bo_domain domain);
> > 
> >      struct radeon_winsys_cs_handle *(*buffer_get_cs_handle)(
> 
> Something I have learned about schedulers is that binary priorities
> are not a good deal. They kind of encourage special case hacks and
> two code paths, they can do less than numeric priorities, and they
> are not significantly easier to implement if you want to do it
> correctly. This is not exactly a scheduler, but it seems similar
> enough.
> So I think a numeric value and >= 3 priorities would be better here,
> then you could also start assigning priority by things like buffer size
> or really any heuristic that can produce some number. Even such
> heuristics are easier to write when you don't need to limit the result
> to true / false.

Hi Andreas,

This boolean is just one component to be used in the final score (for
the plan, see github.com/clbr/jamkthesis). It passes down information
that's otherwise unavailable, ie whether the buffer's type means it
should be more likely to stay in VRAM.

The buffer's size and other factors (patch 3, VRAM size) also influence
the score.

The network won't care if it's a bool or an int, so the question is
just whether having it an int would mean better decisions or not. What
do you think?

- Lauri


More information about the mesa-dev mailing list