sna: extend RandR to support super sized monitor configurations
With the introduction of the third pipe on IvyBridge it is possible to encounter situations where the combination of the three monitors exceed the limits of the scanout engine and so prevent them being used at their native resolutions. (It is conceivable to hit similar issues on earlier generation, especially gen2/3.) One workaround, this patch, is to extend the RandR shadow support to break the extended framebuffer into per-crtc pixmaps. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
e8b090902e
commit
1e9319d5f5
|
|
@ -22,6 +22,7 @@ const OptionInfoRec intel_options[] = {
|
|||
{OPTION_THROTTLE, "Throttle", OPTV_BOOLEAN, {0}, 1},
|
||||
{OPTION_ZAPHOD, "ZaphodHeads", OPTV_STRING, {0}, 0},
|
||||
{OPTION_DELAYED_FLUSH, "DelayedFlush", OPTV_BOOLEAN, {0}, 1},
|
||||
{OPTION_TEAR_FREE, "TearFree", OPTV_BOOLEAN, {0}, 1},
|
||||
#endif
|
||||
#ifdef USE_UXA
|
||||
{OPTION_FALLBACKDEBUG, "FallbackDebug",OPTV_BOOLEAN, {0}, 0},
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ enum intel_options {
|
|||
OPTION_THROTTLE,
|
||||
OPTION_ZAPHOD,
|
||||
OPTION_DELAYED_FLUSH,
|
||||
OPTION_TEAR_FREE,
|
||||
#endif
|
||||
#ifdef USE_UXA
|
||||
OPTION_FALLBACKDEBUG,
|
||||
|
|
|
|||
|
|
@ -1990,7 +1990,6 @@ void _kgem_submit(struct kgem *kgem)
|
|||
if (kgem->wedged)
|
||||
kgem_cleanup(kgem);
|
||||
|
||||
kgem->flush_now = kgem->scanout;
|
||||
kgem_reset(kgem);
|
||||
|
||||
assert(kgem->next_request != NULL);
|
||||
|
|
@ -2486,14 +2485,30 @@ done:
|
|||
return tiling;
|
||||
}
|
||||
|
||||
static int bits_per_pixel(int depth)
|
||||
{
|
||||
switch (depth) {
|
||||
case 8: return 8;
|
||||
case 15:
|
||||
case 16: return 16;
|
||||
case 24:
|
||||
case 30:
|
||||
case 32: return 32;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned kgem_can_create_2d(struct kgem *kgem,
|
||||
int width, int height, int depth)
|
||||
{
|
||||
int bpp = BitsPerPixel(depth);
|
||||
uint32_t pitch, size;
|
||||
unsigned flags = 0;
|
||||
int bpp;
|
||||
|
||||
if (depth < 8) {
|
||||
DBG(("%s: %dx%d @ %d\n", __FUNCTION__, width, height, depth));
|
||||
|
||||
bpp = bits_per_pixel(depth);
|
||||
if (bpp == 0) {
|
||||
DBG(("%s: unhandled depth %d\n", __FUNCTION__, depth));
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2509,6 +2524,8 @@ unsigned kgem_can_create_2d(struct kgem *kgem,
|
|||
I915_TILING_NONE, &pitch);
|
||||
if (size > 0 && size <= kgem->max_cpu_size)
|
||||
flags |= KGEM_CAN_CREATE_CPU | KGEM_CAN_CREATE_GPU;
|
||||
if (size > 0 && size <= kgem->aperture_mappable/4)
|
||||
flags |= KGEM_CAN_CREATE_GTT;
|
||||
if (size > kgem->large_object_size)
|
||||
flags |= KGEM_CAN_CREATE_LARGE;
|
||||
if (size > kgem->max_object_size) {
|
||||
|
|
@ -2524,6 +2541,8 @@ unsigned kgem_can_create_2d(struct kgem *kgem,
|
|||
&pitch);
|
||||
if (size > 0 && size <= kgem->max_gpu_size)
|
||||
flags |= KGEM_CAN_CREATE_GPU;
|
||||
if (size > 0 && size <= kgem->aperture_mappable/4)
|
||||
flags |= KGEM_CAN_CREATE_GTT;
|
||||
if (size > kgem->large_object_size)
|
||||
flags |= KGEM_CAN_CREATE_LARGE;
|
||||
if (size > kgem->max_object_size) {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ struct kgem {
|
|||
uint32_t need_retire:1;
|
||||
uint32_t need_throttle:1;
|
||||
uint32_t scanout:1;
|
||||
uint32_t flush_now:1;
|
||||
uint32_t busy:1;
|
||||
|
||||
uint32_t has_vmap :1;
|
||||
|
|
@ -218,6 +217,7 @@ unsigned kgem_can_create_2d(struct kgem *kgem, int width, int height, int depth)
|
|||
#define KGEM_CAN_CREATE_GPU 0x1
|
||||
#define KGEM_CAN_CREATE_CPU 0x2
|
||||
#define KGEM_CAN_CREATE_LARGE 0x4
|
||||
#define KGEM_CAN_CREATE_GTT 0x8
|
||||
|
||||
struct kgem_bo *
|
||||
kgem_replace_bo(struct kgem *kgem,
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "compiler.h"
|
||||
|
||||
#include <xf86Crtc.h>
|
||||
#include <xf86str.h>
|
||||
#include <windowstr.h>
|
||||
#include <glyphstr.h>
|
||||
#include <picturestr.h>
|
||||
|
|
@ -58,6 +59,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include "../compat-api.h"
|
||||
#define _XF86DRI_SERVER_
|
||||
#include <drm.h>
|
||||
#include <dri2.h>
|
||||
#include <i915_drm.h>
|
||||
|
||||
|
|
@ -209,6 +211,7 @@ struct sna {
|
|||
#define SNA_NO_DELAYED_FLUSH 0x2
|
||||
#define SNA_NO_WAIT 0x4
|
||||
#define SNA_NO_FLIP 0x8
|
||||
#define SNA_TEAR_FREE 0x10
|
||||
|
||||
unsigned watch_flush;
|
||||
unsigned flush;
|
||||
|
|
@ -226,14 +229,16 @@ struct sna {
|
|||
struct list active_pixmaps;
|
||||
struct list inactive_clock[2];
|
||||
|
||||
PixmapPtr front, shadow;
|
||||
PixmapPtr front;
|
||||
PixmapPtr freed_pixmap;
|
||||
|
||||
struct sna_mode {
|
||||
uint32_t fb_id;
|
||||
uint32_t fb_pixmap;
|
||||
drmModeResPtr mode_res;
|
||||
int cpp;
|
||||
drmModeResPtr kmode;
|
||||
|
||||
int shadow_active;
|
||||
DamagePtr shadow_damage;
|
||||
struct kgem_bo *shadow;
|
||||
int shadow_flip;
|
||||
|
||||
struct list outputs;
|
||||
struct list crtcs;
|
||||
|
|
@ -256,6 +261,7 @@ struct sna {
|
|||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
ScreenWakeupHandlerProcPtr WakeupHandler;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
xf86ModeSetProc *ModeSet;
|
||||
|
||||
PicturePtr clear;
|
||||
struct {
|
||||
|
|
@ -302,9 +308,10 @@ struct sna {
|
|||
|
||||
Bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna);
|
||||
void sna_mode_adjust_frame(struct sna *sna, int x, int y);
|
||||
extern void sna_mode_remove_fb(struct sna *sna);
|
||||
extern void sna_mode_update(struct sna *sna);
|
||||
extern void sna_mode_disable_unused(struct sna *sna);
|
||||
extern void sna_mode_wakeup(struct sna *sna);
|
||||
extern void sna_mode_redisplay(struct sna *sna);
|
||||
extern void sna_mode_fini(struct sna *sna);
|
||||
|
||||
extern int sna_crtc_id(xf86CrtcPtr crtc);
|
||||
|
|
@ -356,17 +363,17 @@ to_sna_from_kgem(struct kgem *kgem)
|
|||
|
||||
extern xf86CrtcPtr sna_covering_crtc(ScrnInfoPtr scrn,
|
||||
const BoxRec *box,
|
||||
xf86CrtcPtr desired,
|
||||
BoxPtr crtc_box_ret);
|
||||
xf86CrtcPtr desired);
|
||||
|
||||
extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap,
|
||||
xf86CrtcPtr crtc, const BoxRec *clip);
|
||||
|
||||
Bool sna_dri_open(struct sna *sna, ScreenPtr pScreen);
|
||||
void sna_dri_wakeup(struct sna *sna);
|
||||
void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event);
|
||||
void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event);
|
||||
void sna_dri_close(struct sna *sna, ScreenPtr pScreen);
|
||||
|
||||
extern Bool sna_crtc_on(xf86CrtcPtr crtc);
|
||||
extern bool sna_crtc_on(xf86CrtcPtr crtc);
|
||||
int sna_crtc_to_pipe(xf86CrtcPtr crtc);
|
||||
int sna_crtc_to_plane(xf86CrtcPtr crtc);
|
||||
|
||||
|
|
@ -408,10 +415,12 @@ get_drawable_dy(DrawablePtr drawable)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline Bool pixmap_is_scanout(PixmapPtr pixmap)
|
||||
bool sna_pixmap_attach_to_bo(PixmapPtr pixmap, struct kgem_bo *bo);
|
||||
static inline bool sna_pixmap_is_scanout(struct sna *sna, PixmapPtr pixmap)
|
||||
{
|
||||
ScreenPtr screen = pixmap->drawable.pScreen;
|
||||
return pixmap == screen->GetScreenPixmap(screen);
|
||||
return (pixmap == sna->front &&
|
||||
!sna->mode.shadow_active &&
|
||||
(sna->flags & SNA_NO_WAIT) == 0);
|
||||
}
|
||||
|
||||
PixmapPtr sna_pixmap_create_upload(ScreenPtr screen,
|
||||
|
|
@ -429,6 +438,7 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling);
|
|||
#define MOVE_INPLACE_HINT 0x4
|
||||
#define MOVE_ASYNC_HINT 0x8
|
||||
#define MOVE_SOURCE_HINT 0x10
|
||||
#define __MOVE_FORCE 0x20
|
||||
bool must_check _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags);
|
||||
static inline bool must_check sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ _sna_pixmap_reset(PixmapPtr pixmap)
|
|||
return _sna_pixmap_init(priv, pixmap);
|
||||
}
|
||||
|
||||
static struct sna_pixmap *sna_pixmap_attach(struct sna *sna, PixmapPtr pixmap)
|
||||
static struct sna_pixmap *sna_pixmap_attach(PixmapPtr pixmap)
|
||||
{
|
||||
struct sna_pixmap *priv;
|
||||
|
||||
|
|
@ -657,6 +657,22 @@ static struct sna_pixmap *sna_pixmap_attach(struct sna *sna, PixmapPtr pixmap)
|
|||
return _sna_pixmap_init(priv, pixmap);
|
||||
}
|
||||
|
||||
bool sna_pixmap_attach_to_bo(PixmapPtr pixmap, struct kgem_bo *bo)
|
||||
{
|
||||
struct sna_pixmap *priv;
|
||||
|
||||
priv = sna_pixmap_attach(pixmap);
|
||||
if (!priv)
|
||||
return false;
|
||||
|
||||
priv->gpu_bo = kgem_bo_reference(bo);
|
||||
sna_damage_all(&priv->gpu_damage,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline PixmapPtr
|
||||
create_pixmap(struct sna *sna, ScreenPtr screen,
|
||||
int width, int height, int depth,
|
||||
|
|
@ -724,7 +740,7 @@ sna_pixmap_create_shm(ScreenPtr screen,
|
|||
pixmap->drawable.depth = depth;
|
||||
pixmap->drawable.bitsPerPixel = bpp;
|
||||
|
||||
priv = sna_pixmap_attach(sna, pixmap);
|
||||
priv = sna_pixmap_attach(pixmap);
|
||||
if (!priv) {
|
||||
fbDestroyPixmap(pixmap);
|
||||
return NullPixmap;
|
||||
|
|
@ -816,7 +832,7 @@ sna_pixmap_create_scratch(ScreenPtr screen,
|
|||
pixmap->drawable.depth = depth;
|
||||
pixmap->drawable.bitsPerPixel = bpp;
|
||||
|
||||
priv = sna_pixmap_attach(sna, pixmap);
|
||||
priv = sna_pixmap_attach(pixmap);
|
||||
if (!priv) {
|
||||
fbDestroyPixmap(pixmap);
|
||||
return NullPixmap;
|
||||
|
|
@ -907,7 +923,7 @@ force_create:
|
|||
if (pixmap == NullPixmap)
|
||||
return NullPixmap;
|
||||
|
||||
sna_pixmap_attach(sna, pixmap);
|
||||
sna_pixmap_attach(pixmap);
|
||||
} else {
|
||||
struct sna_pixmap *priv;
|
||||
|
||||
|
|
@ -923,7 +939,7 @@ force_create:
|
|||
pixmap->devKind = pad;
|
||||
pixmap->devPrivate.ptr = NULL;
|
||||
|
||||
priv = sna_pixmap_attach(sna, pixmap);
|
||||
priv = sna_pixmap_attach(pixmap);
|
||||
if (priv == NULL) {
|
||||
free(pixmap);
|
||||
goto fallback;
|
||||
|
|
@ -2508,7 +2524,7 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap, unsigned flags)
|
|||
}
|
||||
}
|
||||
|
||||
if (!sna_pixmap_move_to_gpu(pixmap, flags))
|
||||
if (!sna_pixmap_move_to_gpu(pixmap, flags | __MOVE_FORCE))
|
||||
return NULL;
|
||||
|
||||
/* For large bo, try to keep only a single copy around */
|
||||
|
|
@ -2537,6 +2553,9 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
|
|||
DBG(("%s(pixmap=%ld, usage=%d)\n",
|
||||
__FUNCTION__, pixmap->drawable.serialNumber, pixmap->usage_hint));
|
||||
|
||||
if ((flags & __MOVE_FORCE) == 0 && wedged(sna))
|
||||
return NULL;
|
||||
|
||||
priv = sna_pixmap(pixmap);
|
||||
if (priv == NULL) {
|
||||
DBG(("%s: not attached\n", __FUNCTION__));
|
||||
|
|
@ -12277,7 +12296,6 @@ sna_accel_flush_callback(CallbackListPtr *list,
|
|||
}
|
||||
|
||||
kgem_submit(&sna->kgem);
|
||||
sna->kgem.flush_now = 0;
|
||||
|
||||
kgem_sync(&sna->kgem);
|
||||
|
||||
|
|
@ -12286,8 +12304,7 @@ sna_accel_flush_callback(CallbackListPtr *list,
|
|||
|
||||
static struct sna_pixmap *sna_accel_scanout(struct sna *sna)
|
||||
{
|
||||
PixmapPtr front = sna->shadow ? sna->shadow : sna->front;
|
||||
struct sna_pixmap *priv = sna_pixmap(front);
|
||||
struct sna_pixmap *priv = sna_pixmap(sna->front);
|
||||
return priv && priv->gpu_bo ? priv : NULL;
|
||||
}
|
||||
|
||||
|
|
@ -12298,12 +12315,48 @@ static void sna_accel_disarm_timer(struct sna *sna, int id)
|
|||
sna->timer_ready &= ~(1<<id);
|
||||
}
|
||||
|
||||
static bool has_shadow(struct sna *sna)
|
||||
{
|
||||
DamagePtr damage = sna->mode.shadow_damage;
|
||||
|
||||
if (!(damage && RegionNotEmpty(DamageRegion(damage))))
|
||||
return false;
|
||||
|
||||
DBG(("%s: has pending damage\n", __FUNCTION__));
|
||||
if ((sna->flags & SNA_TEAR_FREE) == 0)
|
||||
return true;
|
||||
|
||||
DBG(("%s: outstanding flips: %d\n",
|
||||
__FUNCTION__, sna->mode.shadow_flip));
|
||||
return !sna->mode.shadow_flip;
|
||||
}
|
||||
|
||||
static bool need_flush(struct sna *sna, struct sna_pixmap *scanout)
|
||||
{
|
||||
DBG(("%s: scanout=%d shadow?=%d || (cpu?=%d || gpu?=%d) && !busy=%d)\n",
|
||||
__FUNCTION__,
|
||||
scanout && scanout->gpu_bo ? scanout->gpu_bo->handle : 0,
|
||||
has_shadow(sna),
|
||||
scanout && scanout->cpu_damage != NULL,
|
||||
scanout && scanout->gpu_bo && scanout->gpu_bo->exec != NULL,
|
||||
scanout && scanout->gpu_bo && __kgem_flush(&sna->kgem, scanout->gpu_bo)));
|
||||
|
||||
if (has_shadow(sna))
|
||||
return true;
|
||||
|
||||
if (!scanout)
|
||||
return false;
|
||||
|
||||
return (scanout->cpu_damage || scanout->gpu_bo->exec) &&
|
||||
!__kgem_flush(&sna->kgem, scanout->gpu_bo);
|
||||
}
|
||||
|
||||
static bool sna_accel_do_flush(struct sna *sna)
|
||||
{
|
||||
struct sna_pixmap *priv;
|
||||
|
||||
priv = sna_accel_scanout(sna);
|
||||
if (priv == NULL || priv->gpu_bo == NULL) {
|
||||
if (priv == NULL && !sna->mode.shadow_active) {
|
||||
DBG(("%s -- no scanout attached\n", __FUNCTION__));
|
||||
sna_accel_disarm_timer(sna, FLUSH_TIMER);
|
||||
return false;
|
||||
|
|
@ -12313,27 +12366,19 @@ static bool sna_accel_do_flush(struct sna *sna)
|
|||
return true;
|
||||
|
||||
if (sna->timer_active & (1<<(FLUSH_TIMER))) {
|
||||
if (sna->kgem.flush_now) {
|
||||
sna->kgem.flush_now = 0;
|
||||
if (priv->gpu_bo->exec) {
|
||||
DBG(("%s -- forcing flush\n", __FUNCTION__));
|
||||
sna->timer_ready |= 1 << FLUSH_TIMER;
|
||||
}
|
||||
}
|
||||
|
||||
DBG(("%s: flush timer active\n", __FUNCTION__));
|
||||
if (sna->timer_ready & (1<<(FLUSH_TIMER))) {
|
||||
DBG(("%s (time=%ld), triggered\n", __FUNCTION__, (long)sna->time));
|
||||
sna->timer_expire[FLUSH_TIMER] =
|
||||
sna->time + sna->vblank_interval;
|
||||
return priv->cpu_damage || !__kgem_flush(&sna->kgem, priv->gpu_bo);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (priv->cpu_damage == NULL &&
|
||||
!__kgem_flush(&sna->kgem, priv->gpu_bo)) {
|
||||
if (!need_flush(sna, priv)) {
|
||||
DBG(("%s -- no pending write to scanout\n", __FUNCTION__));
|
||||
} else {
|
||||
sna->timer_active |= 1 << FLUSH_TIMER;
|
||||
sna->timer_ready |= 1 << FLUSH_TIMER;
|
||||
sna->timer_ready |= 1 << FLUSH_TIMER;
|
||||
sna->timer_expire[FLUSH_TIMER] =
|
||||
sna->time + sna->vblank_interval / 2;
|
||||
DBG(("%s (time=%ld), starting\n", __FUNCTION__, (long)sna->time));
|
||||
|
|
@ -12447,24 +12492,24 @@ static void sna_accel_flush(struct sna *sna)
|
|||
struct sna_pixmap *priv = sna_accel_scanout(sna);
|
||||
bool busy;
|
||||
|
||||
assert(priv != NULL);
|
||||
DBG(("%s (time=%ld), cpu damage? %p, exec? %d nbatch=%d, busy? %d\n",
|
||||
__FUNCTION__, (long)sna->time,
|
||||
priv->cpu_damage,
|
||||
priv->gpu_bo->exec != NULL,
|
||||
priv && priv->cpu_damage,
|
||||
priv && priv->gpu_bo->exec != NULL,
|
||||
sna->kgem.nbatch,
|
||||
sna->kgem.busy));
|
||||
|
||||
busy = priv->cpu_damage || priv->gpu_bo->rq;
|
||||
busy = need_flush(sna, priv);
|
||||
if (!sna->kgem.busy && !busy)
|
||||
sna_accel_disarm_timer(sna, FLUSH_TIMER);
|
||||
sna->kgem.busy = busy;
|
||||
|
||||
if (priv->cpu_damage)
|
||||
sna_pixmap_move_to_gpu(priv->pixmap, MOVE_READ);
|
||||
if (priv) {
|
||||
sna_pixmap_force_to_gpu(priv->pixmap, MOVE_READ);
|
||||
kgem_bo_flush(&sna->kgem, priv->gpu_bo);
|
||||
}
|
||||
|
||||
kgem_bo_flush(&sna->kgem, priv->gpu_bo);
|
||||
sna->kgem.flush_now = 0;
|
||||
sna_mode_redisplay(sna);
|
||||
}
|
||||
|
||||
static void sna_accel_throttle(struct sna *sna)
|
||||
|
|
@ -12811,10 +12856,9 @@ void sna_accel_wakeup_handler(struct sna *sna, fd_set *ready)
|
|||
DBG(("%s\n", __FUNCTION__));
|
||||
if (sna->kgem.need_retire)
|
||||
kgem_retire(&sna->kgem);
|
||||
if (!sna->kgem.need_retire) {
|
||||
if (!sna->mode.shadow_active && !sna->kgem.need_retire) {
|
||||
DBG(("%s: GPU idle, flushing\n", __FUNCTION__));
|
||||
kgem_submit(&sna->kgem);
|
||||
sna->kgem.flush_now = 0;
|
||||
}
|
||||
if (sna->kgem.need_purge)
|
||||
kgem_purge_cache(&sna->kgem);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -73,7 +73,6 @@ struct sna_dri_private {
|
|||
};
|
||||
|
||||
struct sna_dri_frame_event {
|
||||
struct sna *sna;
|
||||
XID drawable_id;
|
||||
ClientPtr client;
|
||||
enum frame_event_type type;
|
||||
|
|
@ -107,9 +106,9 @@ struct sna_dri_frame_event {
|
|||
static DevPrivateKeyRec sna_client_key;
|
||||
|
||||
static inline struct sna_dri_frame_event *
|
||||
to_frame_event(void *data)
|
||||
to_frame_event(uintptr_t data)
|
||||
{
|
||||
return (struct sna_dri_frame_event *)((uintptr_t)data & ~1);
|
||||
return (struct sna_dri_frame_event *)(data & ~1);
|
||||
}
|
||||
|
||||
static inline struct sna_dri_private *
|
||||
|
|
@ -316,7 +315,7 @@ static void _sna_dri_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer)
|
|||
if (buffer == NULL)
|
||||
return;
|
||||
|
||||
DBG(("%s: %p [handle=%d] -- refcnt=%d, pixmap=%d\n",
|
||||
DBG(("%s: %p [handle=%d] -- refcnt=%d, pixmap=%ld\n",
|
||||
__FUNCTION__, buffer, private->bo->handle, private->refcnt,
|
||||
private->pixmap ? private->pixmap->drawable.serialNumber : 0));
|
||||
|
||||
|
|
@ -458,12 +457,8 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (pixmap == sna->front && sync &&
|
||||
(sna->flags & SNA_NO_WAIT) == 0) {
|
||||
BoxRec crtc_box;
|
||||
|
||||
crtc = sna_covering_crtc(sna->scrn, ®ion->extents,
|
||||
NULL, &crtc_box);
|
||||
if (sync && sna_pixmap_is_scanout(sna, pixmap)) {
|
||||
crtc = sna_covering_crtc(sna->scrn, ®ion->extents, NULL);
|
||||
if (crtc)
|
||||
flush = sna_wait_for_scanline(sna, pixmap, crtc,
|
||||
®ion->extents);
|
||||
|
|
@ -707,8 +702,8 @@ static int
|
|||
sna_dri_get_pipe(DrawablePtr pDraw)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pDraw->pScreen);
|
||||
BoxRec box, crtcbox;
|
||||
xf86CrtcPtr crtc;
|
||||
BoxRec box;
|
||||
int pipe;
|
||||
|
||||
if (pDraw->type == DRAWABLE_PIXMAP)
|
||||
|
|
@ -719,18 +714,15 @@ sna_dri_get_pipe(DrawablePtr pDraw)
|
|||
box.x2 = box.x1 + pDraw->width;
|
||||
box.y2 = box.y1 + pDraw->height;
|
||||
|
||||
crtc = sna_covering_crtc(pScrn, &box, NULL, &crtcbox);
|
||||
crtc = sna_covering_crtc(pScrn, &box, NULL);
|
||||
|
||||
/* Make sure the CRTC is valid and this is the real front buffer */
|
||||
pipe = -1;
|
||||
if (crtc != NULL && !crtc->rotatedData)
|
||||
if (crtc != NULL)
|
||||
pipe = sna_crtc_to_pipe(crtc);
|
||||
|
||||
DBG(("%s(box=((%d, %d), (%d, %d)), crtcbox=((%d, %d), (%d, %d)), pipe=%d)\n",
|
||||
__FUNCTION__,
|
||||
box.x1, box.y1, box.x2, box.y2,
|
||||
crtcbox.x1, crtcbox.y1, crtcbox.x2, crtcbox.y2,
|
||||
pipe));
|
||||
DBG(("%s(box=((%d, %d), (%d, %d)), pipe=%d)\n",
|
||||
__FUNCTION__, box.x1, box.y1, box.x2, box.y2, pipe));
|
||||
|
||||
return pipe;
|
||||
}
|
||||
|
|
@ -882,7 +874,8 @@ sna_dri_frame_event_release_bo(struct kgem *kgem, struct kgem_bo *bo)
|
|||
}
|
||||
|
||||
static void
|
||||
sna_dri_frame_event_info_free(struct sna_dri_frame_event *info)
|
||||
sna_dri_frame_event_info_free(struct sna *sna,
|
||||
struct sna_dri_frame_event *info)
|
||||
{
|
||||
DBG(("%s: del[%p] (%p, %ld)\n", __FUNCTION__,
|
||||
info, info->client, (long)info->drawable_id));
|
||||
|
|
@ -890,23 +883,20 @@ sna_dri_frame_event_info_free(struct sna_dri_frame_event *info)
|
|||
list_del(&info->client_resource);
|
||||
list_del(&info->drawable_resource);
|
||||
|
||||
_sna_dri_destroy_buffer(info->sna, info->front);
|
||||
_sna_dri_destroy_buffer(info->sna, info->back);
|
||||
_sna_dri_destroy_buffer(sna, info->front);
|
||||
_sna_dri_destroy_buffer(sna, info->back);
|
||||
|
||||
if (info->old_front.bo)
|
||||
sna_dri_frame_event_release_bo(&info->sna->kgem,
|
||||
info->old_front.bo);
|
||||
sna_dri_frame_event_release_bo(&sna->kgem, info->old_front.bo);
|
||||
|
||||
if (info->next_front.bo)
|
||||
sna_dri_frame_event_release_bo(&info->sna->kgem,
|
||||
info->next_front.bo);
|
||||
sna_dri_frame_event_release_bo(&sna->kgem, info->next_front.bo);
|
||||
|
||||
if (info->cache.bo)
|
||||
sna_dri_frame_event_release_bo(&info->sna->kgem,
|
||||
info->cache.bo);
|
||||
sna_dri_frame_event_release_bo(&sna->kgem, info->cache.bo);
|
||||
|
||||
if (info->bo)
|
||||
kgem_bo_destroy(&info->sna->kgem, info->bo);
|
||||
kgem_bo_destroy(&sna->kgem, info->bo);
|
||||
|
||||
free(info);
|
||||
}
|
||||
|
|
@ -974,7 +964,7 @@ can_flip(struct sna * sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (sna->shadow) {
|
||||
if (sna->mode.shadow_active) {
|
||||
DBG(("%s: no, shadow enabled\n", __FUNCTION__));
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1047,14 +1037,10 @@ inline static uint32_t pipe_select(int pipe)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void sna_dri_vblank_handle(int fd,
|
||||
unsigned int frame, unsigned int tv_sec,
|
||||
unsigned int tv_usec,
|
||||
void *data)
|
||||
void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event)
|
||||
{
|
||||
struct sna_dri_frame_event *info = data;
|
||||
struct sna_dri_frame_event *info = (void *)(uintptr_t)event->user_data;
|
||||
DrawablePtr draw;
|
||||
struct sna *sna;
|
||||
int status;
|
||||
|
||||
DBG(("%s(id=%d, type=%d)\n", __FUNCTION__,
|
||||
|
|
@ -1069,8 +1055,6 @@ static void sna_dri_vblank_handle(int fd,
|
|||
if (status != Success)
|
||||
goto done;
|
||||
|
||||
sna = to_sna_from_drawable(draw);
|
||||
|
||||
switch (info->type) {
|
||||
case DRI2_FLIP:
|
||||
/* If we can still flip... */
|
||||
|
|
@ -1091,7 +1075,8 @@ static void sna_dri_vblank_handle(int fd,
|
|||
/* fall through to SwapComplete */
|
||||
case DRI2_SWAP_THROTTLE:
|
||||
DBG(("%s: %d complete, frame=%d tv=%d.%06d\n",
|
||||
__FUNCTION__, info->type, frame, tv_sec, tv_usec));
|
||||
__FUNCTION__, info->type,
|
||||
event->sequence, event->tv_sec, event->tv_usec));
|
||||
|
||||
if (info->bo && kgem_bo_is_busy(info->bo)) {
|
||||
kgem_retire(&sna->kgem);
|
||||
|
|
@ -1111,8 +1096,8 @@ static void sna_dri_vblank_handle(int fd,
|
|||
}
|
||||
|
||||
DRI2SwapComplete(info->client,
|
||||
draw, frame,
|
||||
tv_sec, tv_usec,
|
||||
draw, event->sequence,
|
||||
event->tv_sec, event->tv_usec,
|
||||
DRI2_BLIT_COMPLETE,
|
||||
info->client ? info->event_complete : NULL,
|
||||
info->event_data);
|
||||
|
|
@ -1121,7 +1106,9 @@ static void sna_dri_vblank_handle(int fd,
|
|||
case DRI2_WAITMSC:
|
||||
if (info->client)
|
||||
DRI2WaitMSCComplete(info->client, draw,
|
||||
frame, tv_sec, tv_usec);
|
||||
event->sequence,
|
||||
event->tv_sec,
|
||||
event->tv_usec);
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING,
|
||||
|
|
@ -1131,7 +1118,7 @@ static void sna_dri_vblank_handle(int fd,
|
|||
}
|
||||
|
||||
done:
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1222,7 +1209,7 @@ static void sna_dri_flip_event(struct sna *sna,
|
|||
flip->event_data);
|
||||
}
|
||||
|
||||
sna_dri_frame_event_info_free(flip);
|
||||
sna_dri_frame_event_info_free(sna, flip);
|
||||
break;
|
||||
|
||||
case DRI2_FLIP_THROTTLE:
|
||||
|
|
@ -1251,10 +1238,10 @@ static void sna_dri_flip_event(struct sna *sna,
|
|||
DRI2_EXCHANGE_COMPLETE,
|
||||
flip->client ? flip->event_complete : NULL,
|
||||
flip->event_data);
|
||||
sna_dri_frame_event_info_free(flip);
|
||||
sna_dri_frame_event_info_free(sna, flip);
|
||||
}
|
||||
} else
|
||||
sna_dri_frame_event_info_free(flip);
|
||||
sna_dri_frame_event_info_free(sna, flip);
|
||||
break;
|
||||
|
||||
#if USE_ASYNC_SWAP && DRI2INFOREC_VERSION >= 7
|
||||
|
|
@ -1298,7 +1285,7 @@ finish_async_flip:
|
|||
|
||||
DBG(("%s: async flip completed\n", __FUNCTION__));
|
||||
sna->dri.flip_pending = NULL;
|
||||
sna_dri_frame_event_info_free(flip);
|
||||
sna_dri_frame_event_info_free(fsna, lip);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -1311,26 +1298,26 @@ finish_async_flip:
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sna_dri_page_flip_handler(int fd, unsigned int frame, unsigned int tv_sec,
|
||||
unsigned int tv_usec, void *data)
|
||||
void
|
||||
sna_dri_page_flip_handler(struct sna *sna,
|
||||
struct drm_event_vblank *event)
|
||||
{
|
||||
struct sna_dri_frame_event *info = to_frame_event(data);
|
||||
struct sna_dri_frame_event *info = to_frame_event(event->user_data);
|
||||
|
||||
DBG(("%s: pending flip_count=%d\n", __FUNCTION__, info->count));
|
||||
|
||||
/* Is this the event whose info shall be delivered to higher level? */
|
||||
if ((uintptr_t)data & 1) {
|
||||
if (event->user_data & 1) {
|
||||
/* Yes: Cache msc, ust for later delivery. */
|
||||
info->fe_frame = frame;
|
||||
info->fe_tv_sec = tv_sec;
|
||||
info->fe_tv_usec = tv_usec;
|
||||
info->fe_frame = event->sequence;
|
||||
info->fe_tv_sec = event->tv_sec;
|
||||
info->fe_tv_usec = event->tv_usec;
|
||||
}
|
||||
|
||||
if (--info->count)
|
||||
return;
|
||||
|
||||
sna_dri_flip_event(info->sna, info);
|
||||
sna_dri_flip_event(sna, info);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1387,7 +1374,6 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
|
||||
info->type = type;
|
||||
|
||||
info->sna = sna;
|
||||
info->drawable_id = draw->id;
|
||||
info->client = client;
|
||||
info->event_complete = func;
|
||||
|
|
@ -1407,7 +1393,7 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
|
||||
if (!sna_dri_page_flip(sna, info)) {
|
||||
DBG(("%s: failed to queue page flip\n", __FUNCTION__));
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1431,7 +1417,6 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
if (info == NULL)
|
||||
return FALSE;
|
||||
|
||||
info->sna = sna;
|
||||
info->drawable_id = draw->id;
|
||||
info->client = client;
|
||||
info->event_complete = func;
|
||||
|
|
@ -1454,7 +1439,7 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
|
||||
vbl.request.sequence = 0;
|
||||
if (sna_wait_vblank(sna, &vbl)) {
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1509,7 +1494,7 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
vbl.request.sequence -= 1;
|
||||
vbl.request.signal = (unsigned long)info;
|
||||
if (sna_wait_vblank(sna, &vbl)) {
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1588,7 +1573,6 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
if (!info)
|
||||
goto blit_fallback;
|
||||
|
||||
info->sna = sna;
|
||||
info->drawable_id = draw->id;
|
||||
info->client = client;
|
||||
info->event_complete = func;
|
||||
|
|
@ -1629,7 +1613,7 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1713,7 +1697,7 @@ blit_fallback:
|
|||
get_private(back)->bo,
|
||||
false);
|
||||
if (info)
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data);
|
||||
*target_msc = 0; /* offscreen, so zero out target vblank count */
|
||||
return TRUE;
|
||||
|
|
@ -1812,7 +1796,7 @@ blit:
|
|||
sna_dri_reference_buffer(back);
|
||||
|
||||
if (!sna_dri_page_flip(sna, info)) {
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
goto blit;
|
||||
}
|
||||
|
||||
|
|
@ -1952,7 +1936,6 @@ sna_dri_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
|
|||
if (!info)
|
||||
goto out_complete;
|
||||
|
||||
info->sna = sna;
|
||||
info->drawable_id = draw->id;
|
||||
info->client = client;
|
||||
info->type = DRI2_WAITMSC;
|
||||
|
|
@ -2009,7 +1992,7 @@ sna_dri_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
|
|||
return TRUE;
|
||||
|
||||
out_free_info:
|
||||
sna_dri_frame_event_info_free(info);
|
||||
sna_dri_frame_event_info_free(sna, info);
|
||||
out_complete:
|
||||
DRI2WaitMSCComplete(client, draw, target_msc, 0, 0);
|
||||
return TRUE;
|
||||
|
|
@ -2093,20 +2076,6 @@ Bool sna_dri_open(struct sna *sna, ScreenPtr screen)
|
|||
return DRI2ScreenInit(screen, &info);
|
||||
}
|
||||
|
||||
void
|
||||
sna_dri_wakeup(struct sna *sna)
|
||||
{
|
||||
drmEventContext ctx;
|
||||
|
||||
DBG(("%s\n", __FUNCTION__));
|
||||
|
||||
ctx.version = DRM_EVENT_CONTEXT_VERSION;
|
||||
ctx.vblank_handler = sna_dri_vblank_handle;
|
||||
ctx.page_flip_handler = sna_dri_page_flip_handler;
|
||||
|
||||
drmHandleEvent(sna->kgem.fd, &ctx);
|
||||
}
|
||||
|
||||
void sna_dri_close(struct sna *sna, ScreenPtr screen)
|
||||
{
|
||||
DBG(("%s()\n", __FUNCTION__));
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <xf86cmap.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86RandR12.h>
|
||||
#include <micmap.h>
|
||||
#include <fb.h>
|
||||
|
||||
|
|
@ -492,8 +493,6 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
|
|||
if (!xf86SetDefaultVisual(scrn, -1))
|
||||
return FALSE;
|
||||
|
||||
sna->mode.cpp = scrn->bitsPerPixel / 8;
|
||||
|
||||
if (!sna_get_early_options(scrn))
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -527,7 +526,10 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
|
|||
sna->flags |= SNA_NO_DELAYED_FLUSH;
|
||||
if (!xf86ReturnOptValBool(sna->Options, OPTION_SWAPBUFFERS_WAIT, TRUE))
|
||||
sna->flags |= SNA_NO_WAIT;
|
||||
if (!has_pageflipping(sna))
|
||||
if (has_pageflipping(sna)) {
|
||||
if (xf86ReturnOptValBool(sna->Options, OPTION_TEAR_FREE, FALSE))
|
||||
sna->flags |= SNA_TEAR_FREE;
|
||||
} else
|
||||
sna->flags |= SNA_NO_FLIP;
|
||||
|
||||
xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Framebuffer %s\n",
|
||||
|
|
@ -540,6 +542,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
|
|||
sna->flags & SNA_NO_THROTTLE ? "dis" : "en");
|
||||
xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Delayed flush %sabled\n",
|
||||
sna->flags & SNA_NO_DELAYED_FLUSH ? "dis" : "en");
|
||||
xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "\"Tear free\" %sabled\n",
|
||||
sna->flags & SNA_TEAR_FREE ? "en" : "dis");
|
||||
|
||||
if (!sna_mode_pre_init(scrn, sna)) {
|
||||
PreInitCleanup(scrn);
|
||||
|
|
@ -608,7 +612,7 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DECL)
|
|||
sna_accel_wakeup_handler(sna, read_mask);
|
||||
|
||||
if (FD_ISSET(sna->kgem.fd, (fd_set*)read_mask))
|
||||
sna_dri_wakeup(sna);
|
||||
sna_mode_wakeup(sna);
|
||||
}
|
||||
|
||||
#if HAVE_UDEV
|
||||
|
|
@ -735,7 +739,6 @@ static void sna_leave_vt(VT_FUNC_ARGS_DECL)
|
|||
|
||||
xf86RotateFreeShadow(scrn);
|
||||
xf86_hide_cursors(scrn);
|
||||
sna_mode_remove_fb(sna);
|
||||
|
||||
ret = drmDropMaster(sna->kgem.fd);
|
||||
if (ret)
|
||||
|
|
@ -747,7 +750,7 @@ static void sna_leave_vt(VT_FUNC_ARGS_DECL)
|
|||
* check that the fd is readable before attempting to read the next
|
||||
* event from drm.
|
||||
*/
|
||||
static Bool sna_dri_has_pending_events(struct sna *sna)
|
||||
static Bool sna_mode_has_pending_events(struct sna *sna)
|
||||
{
|
||||
struct pollfd pfd;
|
||||
pfd.fd = sna->kgem.fd;
|
||||
|
|
@ -767,8 +770,8 @@ static Bool sna_close_screen(CLOSE_SCREEN_ARGS_DECL)
|
|||
#endif
|
||||
|
||||
/* drain the event queues */
|
||||
if (sna_dri_has_pending_events(sna))
|
||||
sna_dri_wakeup(sna);
|
||||
if (sna_mode_has_pending_events(sna))
|
||||
sna_mode_wakeup(sna);
|
||||
|
||||
if (scrn->vtSema == TRUE)
|
||||
sna_leave_vt(VT_FUNC_ARGS(0));
|
||||
|
|
@ -788,7 +791,6 @@ static Bool sna_close_screen(CLOSE_SCREEN_ARGS_DECL)
|
|||
sna->directRenderingOpen = FALSE;
|
||||
}
|
||||
|
||||
sna_mode_remove_fb(sna);
|
||||
if (sna->front) {
|
||||
screen->DestroyPixmap(sna->front);
|
||||
sna->front = NULL;
|
||||
|
|
@ -799,6 +801,20 @@ static Bool sna_close_screen(CLOSE_SCREEN_ARGS_DECL)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void sna_mode_set(ScrnInfoPtr scrn)
|
||||
{
|
||||
struct sna *sna = to_sna(scrn);
|
||||
|
||||
DBG(("%s\n", __FUNCTION__));
|
||||
|
||||
if (sna->ModeSet) {
|
||||
scrn->ModeSet = sna->ModeSet;
|
||||
scrn->ModeSet(scrn);
|
||||
scrn->ModeSet = sna_mode_set;
|
||||
}
|
||||
sna_mode_update(sna);
|
||||
}
|
||||
|
||||
static Bool
|
||||
sna_register_all_privates(void)
|
||||
{
|
||||
|
|
@ -917,9 +933,17 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
|
|||
screen->CloseScreen = sna_close_screen;
|
||||
screen->CreateScreenResources = sna_create_screen_resources;
|
||||
|
||||
sna->ModeSet = scrn->ModeSet;
|
||||
scrn->ModeSet = sna_mode_set;
|
||||
|
||||
if (!xf86CrtcScreenInit(screen))
|
||||
return FALSE;
|
||||
|
||||
xf86RandR12SetRotations(screen,
|
||||
RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270 |
|
||||
RR_Reflect_X | RR_Reflect_Y);
|
||||
xf86RandR12SetTransformSupport(screen, TRUE);
|
||||
|
||||
if (!miCreateDefColormap(screen))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,15 +64,15 @@ CARD32
|
|||
sna_render_format_for_depth(int depth)
|
||||
{
|
||||
switch (depth) {
|
||||
case 1: return PICT_a1;
|
||||
case 4: return PICT_a4;
|
||||
case 8: return PICT_a8;
|
||||
case 15: return PICT_a1r5g5b5;
|
||||
case 16: return PICT_r5g6b5;
|
||||
case 30: return PICT_a2r10g10b10;
|
||||
case 1: return PIXMAN_a1;
|
||||
case 4: return PIXMAN_a4;
|
||||
case 8: return PIXMAN_a8;
|
||||
case 15: return PIXMAN_a1r5g5b5;
|
||||
case 16: return PIXMAN_r5g6b5;
|
||||
case 30: return PIXMAN_a2r10g10b10;
|
||||
default: assert(0);
|
||||
case 24:
|
||||
case 32: return PICT_a8r8g8b8;
|
||||
case 32: return PIXMAN_a8r8g8b8;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ sna_video_clip_helper(ScrnInfoPtr scrn,
|
|||
Bool ret;
|
||||
RegionRec crtc_region_local;
|
||||
RegionPtr crtc_region = reg;
|
||||
BoxRec crtc_box;
|
||||
INT32 x1, x2, y1, y2;
|
||||
xf86CrtcPtr crtc;
|
||||
|
||||
|
|
@ -161,11 +160,12 @@ sna_video_clip_helper(ScrnInfoPtr scrn,
|
|||
* For overlay video, compute the relevant CRTC and
|
||||
* clip video to that
|
||||
*/
|
||||
crtc = sna_covering_crtc(scrn, dst, video->desired_crtc, &crtc_box);
|
||||
crtc = sna_covering_crtc(scrn, dst, video->desired_crtc);
|
||||
|
||||
/* For textured video, we don't actually want to clip at all. */
|
||||
if (crtc && !video->textured) {
|
||||
RegionInit(&crtc_region_local, &crtc_box, 0);
|
||||
crtc_region_local.extents = crtc->bounds;
|
||||
crtc_region_local.data = NULL;
|
||||
crtc_region = &crtc_region_local;
|
||||
RegionIntersect(crtc_region, crtc_region, reg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ sna_video_textured_put_image(ScrnInfoPtr scrn,
|
|||
}
|
||||
|
||||
if (crtc && video->SyncToVblank != 0 &&
|
||||
pixmap == sna->front && !sna->shadow)
|
||||
sna_pixmap_is_scanout(sna, pixmap))
|
||||
flush = sna_wait_for_scanline(sna, pixmap, crtc,
|
||||
&clip->extents);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue