sna: Revert use of a separate CAN_CREATE_SMALL flag

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-01-15 22:21:56 +00:00
parent af85ffdec7
commit 588c5aa6bc
5 changed files with 4 additions and 7 deletions

View File

@ -1102,7 +1102,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
DBG(("%s: buffer size=%d [%d KiB]\n", __FUNCTION__,
kgem->buffer_size, kgem->buffer_size / 1024));
kgem->max_object_size = 2 * kgem->aperture_high / 3;
kgem->max_object_size = 3 * kgem->aperture_high / 4;
kgem->max_gpu_size = kgem->max_object_size;
if (!kgem->has_llc)
kgem->max_gpu_size = MAX_CACHE_SIZE;
@ -3387,8 +3387,6 @@ unsigned kgem_can_create_2d(struct kgem *kgem,
I915_TILING_NONE, &pitch);
DBG(("%s: untiled size=%d\n", __FUNCTION__, size));
if (size > 0) {
if (size < 4096)
flags |= KGEM_CAN_CREATE_SMALL;
if (size <= kgem->max_cpu_size)
flags |= KGEM_CAN_CREATE_CPU;
if (size <= kgem->max_gpu_size)

View File

@ -248,7 +248,6 @@ unsigned kgem_can_create_2d(struct kgem *kgem, int width, int height, int depth)
#define KGEM_CAN_CREATE_CPU 0x2
#define KGEM_CAN_CREATE_LARGE 0x4
#define KGEM_CAN_CREATE_GTT 0x8
#define KGEM_CAN_CREATE_SMALL 0x10
struct kgem_bo *
kgem_replace_bo(struct kgem *kgem,

View File

@ -126,7 +126,7 @@ struct sna_pixmap {
#define PIN_SCANOUT 0x1
#define PIN_DRI 0x2
#define PIN_PRIME 0x4
uint8_t create :5;
uint8_t create :4;
uint8_t mapped :1;
uint8_t shm :1;
uint8_t clear :1;

View File

@ -1224,7 +1224,7 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
ptr = MAKE_STATIC_PTR(pixmap->devPrivate.ptr);
pad = pixmap->devKind;
flags |= KGEM_CAN_CREATE_SMALL;
flags &= ~(KGEM_CAN_CREATE_GPU | KGEM_CAN_CREATE_CPU);
} else {
DBG(("%s: creating GPU pixmap %dx%d, stride=%d, flags=%x\n",
__FUNCTION__, width, height, pad, flags));

View File

@ -97,7 +97,7 @@ too_small(struct sna_pixmap *priv)
if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
return false;
return priv->create & KGEM_CAN_CREATE_SMALL;
return (priv->create & KGEM_CAN_CREATE_GPU) == 0;
}
static inline bool