* Buffer is guaranteed to be laid out linearly in memory. That is, the
* buffer is laid out as an array with 'height' blocks, each block with
* length 'stride'. Each stride is in the same order as the rows of the
- * buffer.
+ * buffer. This is intended to be used with buffers that will be accessed
+ * via dma-buf mmap().
*/
GBM_BO_USE_LINEAR = (1 << 4),
/**
* Buffer inaccessible to unprivileged users.
*/
GBM_BO_USE_PROTECTED = (1 << 8),
+ /**
+ * These flags specify the frequency of software access. These flags do not
+ * guarantee the buffer is linear, but do guarantee gbm_bo_map(..) will
+ * present a linear view.
+ */
+ GBM_BO_USE_SW_READ_OFTEN = (1 << 9),
+ GBM_BO_USE_SW_READ_RARELY = (1 << 10),
+ GBM_BO_USE_SW_WRITE_OFTEN = (1 << 11),
+ GBM_BO_USE_SW_WRITE_RARELY = (1 << 12),
};
int
use_flags |= BO_USE_CAMERA_READ;
if (usage & GBM_BO_USE_PROTECTED)
use_flags |= BO_USE_PROTECTED;
+ if (usage & GBM_BO_USE_SW_READ_OFTEN)
+ use_flags |= BO_USE_SW_READ_OFTEN;
+ if (usage & GBM_BO_USE_SW_READ_RARELY)
+ use_flags |= BO_USE_SW_READ_RARELY;
+ if (usage & GBM_BO_USE_SW_WRITE_OFTEN)
+ use_flags |= BO_USE_SW_WRITE_OFTEN;
+ if (usage & GBM_BO_USE_SW_WRITE_RARELY)
+ use_flags |= BO_USE_SW_WRITE_RARELY;
return use_flags;
}