summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-31sna/video: Add XV_COLORSPACE attribute for the textured Xv adaptorVille Syrjälä
Allow the client to select between BT.601 and BT.709 via the XV_COLORSPACE port attribute with the textured Xv adaptor as well. Since the BT.601 coefficients are currently hardcoded in the yuv->rgb shader, let's just add a mostly duplicated shader with hardcoded BT.709 coefficients instead. Not the most elegant solution but avoids having to touch any state setup etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-31Rename current yuv->rgb shader sources to exa_wm_yuv_rgb_bt601Ville Syrjälä
Our current yuv->rgb shaders follow the BT.601 conversion formula. Rename the shader sources to indicate that fact. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-31Remove duplicate exa_wm_yuv_rgb.g5a shader sourceVille Syrjälä
exa_wm_yuv_rgb.g5a is identical to exa_wm_yuv_rgb.g4a. Just use a symlink intead of duplicating the whole file. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-12configure: Set DRI1 to autodiscoverChris Wilson
We only need DRI1 to support UMS on i810, but modern Xservers don't support DRI1 and the support infrastructure is no longer being shipped on some distributions. Gracefully fail if we can't compile the DRI1 code blocks for i810. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-02Add Coffeelake PCI IDs for U SkusLiwei Song
Add the Coffeelake PCI IDs based on the following kernel patch: commit d29fe702c9cb682df99146d24d06e5455f043101 Author: Anusha Srivatsa <anusha.srivatsa@intel.com> Date: Thu Jun 8 16:41:07 2017 -0700 drm/i915/cfl: Add Coffee Lake PCI IDs for U Sku. Signed-off-by: Liwei Song <liwei.song@windriver.com>
2018-05-02Add Coffeelake PCI IDs for H SkusLiwei Song
Add the Coffeelake PCI IDs based on the following kernel patches: commit ccfd13215fd25a0e8c28221f3acc0dcaec11cd15 Author: Anusha Srivatsa <anusha.srivatsa@intel.com> Date: Thu Jun 8 16:41:06 2017 -0700 drm/i915/cfl: Add Coffee Lake PCI IDs for H Sku. Signed-off-by: Liwei Song <liwei.song@windriver.com>
2018-04-24sna/video/sprite: Retry with GPU scaling if setplane failsVille Syrjälä
The kernel may reject the setplane due to eg. exceeding the max downscaling limit of the hardware. In that case let's retry the operation but let the GPU do the scaling for us. Tested on my IVB, after hacking the kernel to reject setplane which exceeds the max hw downscaling limit. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-24sna/video/sprite: Remove stale video->planeVille Syrjälä
video->plane is never populated so nuke it. Its only user can be nuked as well since all it's trying to do is turn off the plane (which fails on account plane_id being zero). We don't need to disable the plane immediately upon the setplane failure as the higher level code will end up stopping the entire port on error, and thus the plane will get disabled just fine. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-15sna/present: Only add the first element to the Timer queueChris Wilson
TimerSet scales linearly with the number of elements in the queue as it performs an insertion sort, duplicating the sorting we also perform to keep the per-crtc vblank queue in an orderly fashion. As we already maintain the ordered timeline of vblanks, we can simply queue the next when the current vblank completes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-13sna: Handle wedged devices during sna_crtc_redisplayChris Wilson
If the device is already wedged (no GPU), jump straight to the swrast path for performing the per-crtc transformations. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105420 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-06sna: Add some debug output for clipping in stippled_1_bltChris Wilson
Having just chased a bug along this path, I found the following debug helpful in a narrowing down why certain paths were chosen. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-06sna: Fix the relocation dword for stippled_1_bltChris Wilson
We were telling the kernel the correct location for it to fill the 64b relocation, but we were writing the presumed offset into the wrong pair of dwords in the batch ourselves. For the frequent case where we used a new upload buffer, the kernel would perform the fixup and correct our mistake, but if we happened to reuse a buffer then we told the gpu to source the stipple from the wrong address. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105886 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-04sna: Discard the per-crtc TearFree back buffer on resizeChris Wilson
When we mix TearFree and per-crtc pixmaps (e.g. for RandR transformations), we stash the old buffer on the CRTC for double buffering. However, this buffer needs to be reallocated when we change output resolutions, as the CRTC size may change. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-04sna: Always sync before using mmap pointers in memcpy_copy_boxesChris Wilson
kgem_bo_map__(cpu|gtt) leaves the sync up to the caller, in particular so that the obtaining the pointer and controlling the cache domains are not conflated and can be separated. However, it does mean that the caller can not assume that obtaining the pointer updates the cache domains, as it does not. memcpy_copy_boxes fell into this trap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-03sna: Reorder vblank/flip event handling to avoid TearFree recursionChris Wilson
TearFree wants to grab the most recently used scanout for rendering the next frame into. If the flip event was still pending, we would then query the drm event buffer for any pending completions, but this would proceed to execute all the other events before the flip events as well. Since we they were out of sequence, we pushed them into a buffer to execute afterwards, however we forgot the side effects of the flip handlers, for example see commit af36a4ab78cc ("sna: Defer submission of the next shadow frame until halfway through") and that there may have been events read from drm into a local buffer inside sna_mode_wakeup() that haven't been processed yet. Eliminate the need for calling sna_mode_wakeup() by ensuring that all flip events have been completed first before handing the vblank callbacks and potential drawing, ensuring the correct ordering. References: https://bugs.freedesktop.org/show_bug.cgi?id=105720 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-03sna: Skip shadow redisplay if flips still pendingChris Wilson
We shouldn't even be attempting to redisplay if there are flips pending, so exit early and expect to be called again after the pending flips complete. Exiting early avoids having to call sna_mode_wakeup() in what used to be a potentially recursive manner (see commit af36a4ab78cc "sna: Defer submission of the next shadow frame until halfway through"). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-03sna: Report the move_to_gpu failed if the allocation failedChris Wilson
Do not try and workaround the failure by forcing the wait-for-flip as we may be inside a vblank handler already. Just report the move failed and expect the caller to skip the draw, fairly standard practice for allocation failure handling (stale output rather than crash). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-01sna: Defer submission of the next shadow frame until halfway throughChris Wilson
Do not immediately post the next shadow flip on completion of the current flips, but instead queue a timer for half way through the next vblank so that try to we keep the additional input-output lag to less than a frame. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-01sna: Force posting of shadow updates for NotifyFdChris Wilson
The update for ABI 22 and NotifyFd left behind an important flush for shadow rendering. Fixes: 4ab9145c7748 ("Update to ABI 22 and NotifyFd") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-28sna/dri2: Clip application of damage to windowed swapbuffersChris Wilson
Since forever we have been passing region=NULL when doing a windowed swapbuffer on vblank, and using that to mark the entire pixmap as being damaged. For an uncomposited window, this is incorrect as it points to a clipped region of the ScreenPixmap and so we were marking the entire ScreenPixmap as being flushed, but only having operated on the windowed region. Instead pass along the clip extents if region is unset. References: https://bugs.freedesktop.org/show_bug.cgi?id=105720 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-26sna: Fixup early assert of xf86ScrnToScreenChris Wilson
During early init, xf86ScrnToScreen() may return NULL, so handle that possibility inside the assert. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-02sna: CustomEDID fixdom.constant@free.fr
For my HTPC setup, I'm using the option "CustomEDID". With this option, output attaching and destroying events leads to crashes. The following sequence leads to a crash: - In xorg.conf: Option "CustomEDID" "HDMI2:/etc/my_edid.bin" - Starting Xorg - Connect HDMI2 - Disconnect HDMI2 - Reconnect HDMI2 -> Crash The crash happens in xf86OutputSetEDID (xorg/xserver/hw/xfree86/modes/xf86Crtc.c) at "free(output->MonInfo)". MonInfo is assigned with sna_output->fake_edid_mon which is allocated by intel driver in sna_output_load_fake_edid (src/sna/sna_display.c). Sequence details: - Starting Xorg -> fake_edid_mon is initialized - Connect HDMI2 -> xf86OutputSetEDID is called: - MonInfo is NULL - MonInfo is assigned with fake_edid_mon pointer - MonInfo is read by Xorg - Disconnect HDMI2 - Reconnect HDMI2 -> xf86OutputSetEDID is called: - MonInfo is freed thus also fake_edid_mon - MonInfo is assigned with fake_edid_mon - MonInfo is read but it was freed -> CRASH The fix consists of a new instance of xf86MonPtr for each calls of xf86OutputSetEDID. is initialized with fake_edid_raw which render fake_edid_mon useless. With this proposal, the behaviour of an EDID override is similar to a "real" EDID. Signed-off-by: Dominique Constant <dom.constant@free.fr> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-02sna: Add XV_COLORSPACE attribute support for sprite Xv adaptorsVille Syrjälä
Use the new "COLOR_ENCODING" plane property to implement the XV_COLORSPACE port attribute for sprite Xv adaptors. v2: assert(colorspace < ARRAY_SIZE) (Chris) Cc: Jyri Sarha <jsarha@ti.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-14sna/video: Actually use the NV12 shader on gen8Ville Syrjälä
Oops. We never actually select the NV12 shader on gen8, causing us to render garbage. Looks like this is the only one I somehow missed. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-08intel: Only check file type bits not mode when searching for rendernodesChris Wilson
Before checking st_rdev, we first need to validate that the file is a device node, but we only want to check the file type bits and not compare the permissions. Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-07sna: Switch from ifdef PICT_ to if XORG_VERSION_CURRENTChris Wilson
The PICT_ are enums and so never report true to ifdef PICT_a2r10g10b10 and instead we need to check the xserver version they were introduced. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-06meson: Add meson build systemVille Syrjälä
Allow building the driver with meson. Could probably use plenty of cleanups, but at least it gives me a working driver. And I think I managed to make it build everything that autotools builds. Quite a few compiler warnings were suppressed as well. Might want to look at those at some point. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-02-06autotools: Nuke IPC_RMID_DEFERRED_RELEASEVille Syrjälä
IPC_RMID_DEFERRED_RELEASE is unused so nuke it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-02-06sna: Make DBG() and ERR() non-emptyVille Syrjälä
Use do{}while(0) for DBG() and ERR() to avoid isses with if/else/etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-02-06sna/video: Try to use hw scaling with SKL+ spritesVille Syrjälä
SKL reintroduced plane scaling once more. Let's try to make use of it. The one annoying caveat is that you can't do colorkeying and scaling at the same time :( For now we'll leave the choice of colorkey vs. scaling to the user via that XV_ALWAYS_ON_TOP attribute. One possible idea for improving the situation would be to add support for autopaint colorkey, and automatically disable the colorkey whenever the window is not obscured by anything and autopaint colorkey is enabled. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-01-11Add Coffeelake PCI IDs for S SkusLiwei Song
Add the Coffeelake PCI IDs based on the following kernel patches: commit b056f8f3d6b900e8afd19f312719160346d263b4 Author: Anusha Srivatsa <anusha.srivatsa@intel.com> Date: Thu Jun 8 16:41:05 2017 -0700 drm/i915/cfl: Add Coffee Lake PCI IDs for S Skus. Signed-off-by: Liwei Song <liwei.song@windriver.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-20sna: Drop redundant sync of an inactive snoop cacheChris Wilson
Having requested an inactive snooped buffer, we know that it is already flushed and do not need to flush it again. With debugging enabled, we hit an assert while flushing that the buffer has a refcout, which at this present time of being plucked from the snoop cache it does not. Reported-by: Adric Blake <promarbler14@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=104341#c2 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-20sna: Fixup sna->scrn == scrn assert for early initialisationChris Wilson
Very early on when creating the sna privates, we call to_sna(scrn) before we have even set the sna->scrn backpointer. Reorder the code such that we always set sna->scrn before the first to_sna() so that the assert(to_sna(scrn)->scrn == scrn) can always hold. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-16sna: Avoid calling kgem_bo_free() on a still active boChris Wilson
If we fail to manipulate a bo from the active cache for reuse, then we have to be careful not to immediately close it as it is still referenced from the current batch. Reported-by: Adric Blake <promarbler14@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c44 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-09sna: Assert idempotent conversions between sna <-> ScreenPtrChris Wilson
Check that the struct sna we retrieve from the ScreenPtr points back to the screen, and vice versa. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-09sna: Update vtSema for Leave/EnterVTChris Wilson
Xorg changed behaviour in 78f0667d6df9 (xf86Events: split xf86VTSwitch into xf86VTLeave and xf86VTEnter functions) and stopped altering the state of scrn->vtSema around calls to Leave/EnterVT. So we must do so ourselves (albeit a bit belated in noticing the change!) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-09sna: Disable DPMS-deferred modesetting when run as a secondary screenChris Wilson
When being run as a secondary screen, we do not receive DPMS events (xf86DPMS() only operates on the primary screen, I guess one day we will have to fix that and undo this hack). As such we cannot defer the modesets until the final DPMS as it will never be sent. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103618 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-08sna: Allow a PRIME pixmap to be reusedChris Wilson
The code expected that a fresh pixmap header to be created for each PRIME pixmap, but it appears that set_shared_pixmap is being called on the same pixmap with fd=-1. References: https://bugs.freedesktop.org/show_bug.cgi?id=103618 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-18sna: Implement i830 3DSTATE_BUFFER_INFO w/aVille Syrjälä
i830 can hang if 3DSTATE_BUFFER_INFO straddles two cachelines. To prevent that emit MI_NOOPs to align 3DSTATE_BUFFER_INFO to a cacheline boundary. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-10-12sna: Fix up assert()sChris Wilson
Two pushes later and the discovery that the build scripts no longer do a debug build leads to some embarrassment. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-12sna: Validate rrPrimaryOutput belongs to our ScreenChris Wilson
If the randr->rrPrimaryOutput is set to an output on a slave, we have to reject it in favour of one of our own. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-12sna: Move the public sna_crtc fields into a named structChris Wilson
Avoid compiler trickery by making the layout of the sna_crtc_public pointed to by xf86CrtcPtr->devPrivate known. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-08sna: Avoid fopen inside signalsafe debug pathsChris Wilson
We need the debug code to be signalsafe as it may be run when updating the cursor from a signal. This excludes the use of fopen() as it may malloc (causing a potential recursion upon the malloc locks). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-08sna/present: Queue the keepalive vblankChris Wilson
Insert the keepalive vblank into the sorted list of msc carefully. This way we can discard redundant keepalives - as we don't want to queue a second event for the same vblank needlessly. Reported-by: Adric Blake <promarbler14@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c13 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-07sna: Check if the kernel reports a tiling-stride less than our requestChris Wilson
Looks like a bug has snuck in somewhere in our set-tiling path. Since it exists, try to workaround it whilst it is root caused. Reported-by: Adric Blake <promarbler14@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c9 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-06sna: Skip the exact match if we can't change tilingChris Wilson
If we can't change tiling on the cached bo and we expect an exact match (for e.g. scanout) then skip over the unwanted bo. Reported-by: Adric Blake <promarbler14@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c5 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-27sna/video: Expose NV12 support for the textured Xv adaptor on gen4+Ville Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-27sna/video: Add NV12 video copy funcsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-27sna/video: Add support for NV12 video in all gen4+ render pathsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-27sna/video: Add NV12 shader binariesVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>