On Mon, Aug 31, 2015 at 08:01:21PM +0100, Emil Velikov wrote:
Reusing bo_gem here is a little worrying as it would be very easy for someone to add code to the end of the function thinking that bo_gem still was the batch.
Doesn't this concert apply to drm_intel_gem_bo_exec() as well ?
Probably. Haven't looked at that in years. :p
If we had
static inline drm_intel_bo_gem *to_bo_gem(drm_intel_bo *bo) { return (drm_intel_bo_gem *)bo; }
then we can start doing one offs like
if (to_bo_gem(bo)->has_error) return -ENOMEM;
and of course for (i = 0; i < bufmgr_gem->exec_count; i++) { drm_intel_bo_gem *bo_gem = to_bo_gem(bufmgr_gem->exec_bos[i]);
How about we do this as a follow up patch (4.1/17) that covers both functions ?
If you are quick... -Chris