Re: [PATCH 1/3] drm/i915/gtt: pde entry encoding is identical

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Mika Kuoppala (2019-07-04 16:44:05)
> +#define set_pd_entry(pd, pde, to)  ({                             \
> +       __write_pd_entry((pd), (pde), px_base(to), gen8_pde_encode); \
> +       atomic_inc(&(pd)->used);                                   \

inc before write so that you have a nice onion with clear.

> +})
> +
> +#define clear_pd_entry(pd, pde, to) ({                              \

You want to pull the GEM_BUG_ON here so that is tightly coupled with the
atomic_dec -- it's an underflow check.

> +       __write_pd_entry((pd), (pde), px_base(to), gen8_pde_encode); \
> +       atomic_dec(&pd->used);                                       \
> +})

I would have preferred these as inlines (even if means "passing" an
extra arg), but let's see what the next two patches bring.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux