Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • coypoop/xf86-video-intel
  • adamjrichter/xf86-video-intel
  • banzr/xf86-video-intel
  • E5ten/xf86-video-intel
  • ross/xf86-video-intel
  • thomas.preston/xf86-video-intel
  • hanno/xf86-video-intel
  • Ma/xf86-video-intel
  • airlied/xf86-video-intel
  • develomentional/xf86-video-intel
10 results
Show changes
Commits on Source (2)
  • Chris Wilson's avatar
    sna: Defer fbGetWindowPixmap() for sna_composite · 9236c582
    Chris Wilson authored
    Mike Lothian ran into a surprising situation where compScreenUpdate was
    calling CompositePicture without a pixmap attached to the destination
    Window, and so we found ourselves chasing a NULL PixmapPtr.
    
      #1  to_sna_from_pixmap (pixmap=0x0) at sna.h:521
      #2  sna_composite (op=<optimized out>, src=0x55b3346c1420, mask=0x0,
          dst=0x55b3346c1d50, src_x=<optimized out>, src_y=<optimized out>, mask_x=0,
          mask_y=0, dst_x=0, dst_y=0, width=3840, height=2160) at sna_composite.c:652
      #3  0x000055b33202c208 in damageComposite (op=<optimized out>,
          pSrc=0x55b3346c1420, pMask=0x0, pDst=0x55b3346c1d50, xSrc=<optimized out>,
          ySrc=<optimized out>, xMask=0, yMask=0, xDst=0, yDst=0, width=3840,
          height=2160) at damage.c:513
      #4  0x000055b33201820c in CompositePicture (op=<optimized out>,
          op@entry=1 '\001', pSrc=pSrc@entry=0x55b3346c1420, pMask=pMask@entry=0x0,
          pDst=pDst@entry=0x55b3346c1d50, xSrc=xSrc@entry=0, ySrc=ySrc@entry=0,
          xMask=0, yMask=0, xDst=0, yDst=0, width=3840, height=2160) at picture.c:1547
      #5  0x000055b331fc85d3 in compWindowUpdateAutomatic (
          pWin=pWin@entry=0x55b3343a6bc0) at compwindow.c:705
      #6  0x000055b331fca029 in compPaintWindowToParent (pWin=pWin@entry=0x55b3343a6bc0)
          at compwindow.c:729
      #7  0x000055b331fc9fbb in compPaintChildrenToWindow (pWin=0x55b333e77b50)
          at compwindow.c:744
      #8  0x000055b331fca59f in compScreenUpdate (pClient=<optimized out>,
          closure=<optimized out>) at compalloc.c:57
      #9  0x000055b331f3abf4 in ProcessWorkQueue () at dixutils.c:536
      #10 0x000055b3320aaa51 in WaitForSomething (are_ready=<optimized out>)
          at WaitFor.c:192
      #11 0x000055b331f361a9 in Dispatch () at dispatch.c:421
      #12 0x000055b331f39cec in dix_main (argc=13, argv=0x7ffcf273f538,
          envp=<optimized out>) at main.c:276
      #13 0x000055b331f247de in main (argc=<optimized out>, argv=<optimized out>,
          envp=<optimized out>) at stubmain.c:34
    
    Fortuitously, that drawable was also fully clipped so that it took an
    early exit and so we can hide the segfault by delaying querying the
    pixmap until after the clip check.
    
    The ongoing mystery is how we ended up in that state in the first place.
    
    Closes: #204
    
    
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    9236c582
  • Chris Wilson's avatar
    sna: Enable TearFree by default on recent HW · a511f22c
    Chris Wilson authored
    When there is ample memory bandwidth and we are not fighting for global
    resources, enable TearFree by default. Avoiding tearing is much more
    pleasant (for direct rendering where the source itself is not being
    synchronized to vblank) at negligible power cost; just doubles the
    memory footprint of scanout.
    
    References: https://gitlab.freedesktop.org/drm/intel/-/issues/2799
    References: https://gitlab.freedesktop.org/drm/intel/-/issues/2763
    
    
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    a511f22c
......@@ -1944,6 +1944,19 @@ static uint64_t get_gtt_size(int fd)
return aperture.aper_size;
}
static int get_gtt_type(int fd)
{
struct drm_i915_getparam p;
int val = 0;
memset(&p, 0, sizeof(p));
p.param = I915_PARAM_HAS_ALIASING_PPGTT;
p.value = &val;
drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &p);
return val;
}
void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
{
size_t totalram;
......@@ -2108,6 +2121,8 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
!DBG_NO_CPU && (kgem->has_llc | kgem->has_userptr | kgem->has_caching),
kgem->has_llc, kgem->has_caching, kgem->has_userptr));
kgem->has_full_ppgtt = get_gtt_type(fd) > 1;
gtt_size = get_gtt_size(fd);
kgem->aperture_total = gtt_size;
kgem->aperture_high = gtt_size * 3/4;
......
......@@ -191,6 +191,7 @@ struct kgem {
uint32_t has_pinned_batches :1;
uint32_t has_caching :1;
uint32_t has_coherent_mmap_gtt :1;
uint32_t has_full_ppgtt :1;
uint32_t has_llc :1;
uint32_t has_wt :1;
uint32_t has_no_reloc :1;
......
......@@ -649,15 +649,15 @@ sna_composite(CARD8 op,
CARD16 width, CARD16 height)
{
PixmapPtr pixmap = get_drawable_pixmap(dst->pDrawable);
struct sna *sna = to_sna_from_pixmap(pixmap);
struct sna_pixmap *priv;
struct sna_composite_op tmp;
RegionRec region;
struct sna *sna;
int dx, dy;
DBG(("%s(pixmap=%ld, op=%d, src=%ld+(%d, %d), mask=%ld+(%d, %d), dst=%ld+(%d, %d)+(%d, %d), size=(%d, %d)\n",
__FUNCTION__,
pixmap->drawable.serialNumber, op,
pixmap ? pixmap->drawable.serialNumber : 0, op,
get_picture_id(src), src_x, src_y,
get_picture_id(mask), mask_x, mask_y,
get_picture_id(dst), dst_x, dst_y,
......@@ -672,8 +672,7 @@ sna_composite(CARD8 op,
if (op == PictOpClear) {
DBG(("%s: discarding source and mask for clear\n", __FUNCTION__));
mask = NULL;
if (sna->clear)
src = sna->clear;
src = NULL;
}
if (!sna_compute_composite_region(&region,
......@@ -694,11 +693,6 @@ sna_composite(CARD8 op,
if (NO_COMPOSITE)
goto fallback;
if (wedged(sna)) {
DBG(("%s: fallback -- wedged\n", __FUNCTION__));
goto fallback;
}
if (!can_render_to_picture(dst)) {
DBG(("%s: fallback due to unhandled picture\n", __FUNCTION__));
goto fallback;
......@@ -711,6 +705,15 @@ sna_composite(CARD8 op,
goto fallback;
}
sna = to_sna_from_pixmap(pixmap);
if (wedged(sna)) {
DBG(("%s: fallback -- wedged\n", __FUNCTION__));
goto fallback;
}
if (op == PictOpClear)
src = sna->clear;
if (use_cpu(pixmap, priv, op, width, height) &&
!picture_is_gpu(sna, src, PREFER_GPU_RENDER) &&
!picture_is_gpu(sna, mask, PREFER_GPU_RENDER)) {
......
......@@ -459,7 +459,18 @@ static bool enable_tear_free(struct sna *sna)
if (sna->flags & SNA_LINEAR_FB)
return false;
/* Under certain conditions, we should enable TearFree by default,
/*
* On recent HW, where the display surfaces are in a seperate GTT
* to userspace, there is much less contention on global resources
* and also we can assume there is much more memory bandwidth
* available (i.e. gen8+). This HW should rarely be under such
* constaints as to need to disable TearFree, so enable by default.
*/
if (sna->kgem.has_full_ppgtt)
return true;
/*
* Under certain conditions, we should enable TearFree by default,
* for example when the hardware requires pageflipping to run within
* its power/performance budget.
*/
......