Age | Commit message (Collapse) | Author |
|
When creating a new pixmap/bo for dri2 drawable there is no need to create a
new texture, instead the texture associated with the new pixmap should be use
otherwise there is a missmatch between the bo backing the texture for the
drawable and the bo used by dri2 client.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60182
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
The 'frame' argument passed to event handlers is the plain
CRTC vblank counter that stops progressing when the
associated display is in DPMS-off mode. If we have a
DPMS-off period the frame counter and MSC will
diverge, which can cause some higher-level functions
to return incorrect values.
This patch fixes the problem by adding interpolated
vblanks to the frame counter before using it in handler
functions.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Now that we fully emulating a running CRTC through DPMS-off state
it is possible to come up with a zero delay when scheduling
a swap or MSC-wait (e.g., if a call into respective wait function
was entered very late). This patch wraps the TimerSet function
into our own radeon_dri2_schedule_event such that the latter
calls the event right away if zero delay is specified.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Now that the running CRTC is emulated through DPMS-off
states, wait_msc and get_msc must also work on disabled
CRTCs. When CRTC is disabled, we must extrapolate the
MSC count from present time and last MSC when CRTC was
running and also use timers facility in wait_msc.
v2: CRTC-private now stores frame rate instead of nominal
vblank period.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
radeon_dri2_deferred_swap will be used to generate
real events (not just fallbacks) so now it needs to
generate real timestamp and frame counter. Also
this function will be used both by schedule_swap
and wait_msc, so give it a more generic name:
radeon_dri2_deferred_event
v2: - Extrapolate the frame number from the time
of actual execution of the function instead
of using the MSC calculated (extrapolated)
at event scheduling time.
- CRTC-private now stores frame rate instead of
nominal vblank period.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Tracking the CRTC associated with an event will save us
some lookups later in event handlers.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
This patch hooks up swap-scheduling function with
vblank-extrapolation function. Rather than waiting for
fixed time, we calculate exactly how much we should wait
and what we should update target_msc to using
radeon_dri2_extrapolate_msc_delay helper function
and schedule the swap completion using DIX's timer facility.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Implement a helper function that will be called when emulating
the running CRTC. The function should be called only when CRTC
is in DPMS-off state. It will look at the vblank count and the
time that was recorded last time the CRTC was running and
calculate how long one must wait (from present time) until
the target_msc is reached if the CRTC were running.
v2: - CRTC-private now stores frame rate instead of nominal
vblank period.
- DIX's timer facility can sometimes wake up the scheduled
functions more than a millisecond earlier. To avoid
generating an old MSC, we have to add more margin when
converting the delay in microseconds to milliseconds.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Normally, MSC value equals the vblank count of the CRTC
on which the drawable resides. However, we are now interpolating
vblanks through DPMS-off state, so if the CRTC is turned
off at some point, the vlbank count does not change, but
MSC does change by the amount that equals the cumulative
number of interpolated vblanks.
So each time we interact with the CRTC's vblank facility,
we have to adjust the vblank counter: in the request, we
have to subtract the number of interpolated vblanks from
MSC and in the reply we have to add the number of interpolated
vblanks to the MSC.
This patch only makes the MSC correct when CRTC is on.
The subsequent patch will construct the MSC when CRTC is not
running.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
We'll need to use this function in other .c files so
remove static annotation from it. Also, add radeon_
prefix because this function is now part of global namespace,
so it would be nice to know where it is coming from.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
This function no longer uses info argument, so nuke it.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Fixes piglit sanity.tests (with 3D drivers which allocate depth buffers from
the X server).
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
The main purpose is to drop DRI2 compatibility code paths which are getting
awkward to deal with and at this point are probably only tested lightly if at
all. xserver 1.7 was released more than 3 years ago, and 1.6.2 was already
required before.
Mostly mechanical, there's probably potential for more cleanups.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
If drawable is displayed on a CRTC and relevant CRTC is in
DPMS off state, defer the swap by a fixed (hard-coded) time.
This patch fixes a bug that caused an application to render
at uncontrolled rate when CRTC goes into DPMS "off" state,
thus thrashing the GPU and CPU and likely offsetting the
power savings achieved by shutting off the display.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Return pointer to the CRTC instead of CRTC ID and expose
consider_disabled option in arguments of this function.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
This patch adds an option called consider_disabled to
radeon_pick_best_crtc function. If this option is set
and searching for best-fit CRTC yields nothing, the search
will be widened to include CRTCs in DPMS "off" state.
The new option is not used yet; it will be in the patches
to follow.
v2: Do not look at the CRTC mode, we only care about its box.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
We might get a request for a pixmap/drawable that is too big
for GPU capabilities in the dri2 get buffer path. In face of
such things just return NULL to dri2 get buffer request. The
GL driver should then use something like transparent black to
avoid something too ugly on the screen.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Okay kwin did things different, and I really hope this time this is the
correct transformation operation. It works here with gears under kwin
and under mutter and under xcompmgr.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
when you use MPX or slave usb devices, the damage posting was incorrect,
and resulted in misrendered boxes on the screen.
Fix it by reporting damage correctly.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
Improves performance of non-pageflipped 3D apps on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Older servers won't have DRI2UpdatePrime, so fix build.
bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54433
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
This adds the new dri2 interfaces required for radeon to be offloaded to.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
in order for offload to work we need to cause a full
screen damage to be registered after pageflip.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Defaults to shadowfb. 3D acceleration is available with glamor. 2D
acceleration is disabled until the radeonsi driver can handle glamor's
shaders.
v2: add chip flags (Alex Deucher)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Enable at build time with --enable-glamor and runtime with
Option "AccelMethod" "glamor"
The most notable lack of functionality is XVideo. Use something like VDPAU for
now.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
This overhauls the radeon driver and removes all the old UMS-only code,
it drops all the UMS, DRI1, XAA, overlay Xv, video capture, tv tuners
There are probably a lot more cleanups that will fall out of this afterwards.
So far this is compile/build tested.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
We don't know what the CRTC state is.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
The compat header takes care of the old server vs new server.
this commit was autogenerated from util/modular/x-driver-screen-scrn-conv.sh
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
Deferring this could result in trying to unreference buffers from a previous
server generation, i.e. accessing freed memory.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Christian König <Christian.koenig@amd.com>
|
|
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45937
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Use libdrm common surface code so mesa,ddx have same idea
about tiling surface and what their pitch should be and
the alignment constraint.
v2 fix remaining issue add new option to conditionaly enable
v3 fix fbcon copy and r600 exa copy path
v4 fix non tiled path 2D tiling on GPU >= R600, set it to false
as default
v5 adapt to pixel/element size split of libdrm/radeon
v6 update to properly handle falling back to 1d tiled
v6 final fix to tile split value on evergreen and newer
v7 fix default array mode on r6xx, fix height alignment issue
on evergreen
v8 fix tile split value
v9 add stencil tile split support, simplify dri2 for stencil
with evergreen
v10 Try to fix xv path regarding tiling. Adapt to libdrm API
change. Try to fix case where there is no surface which
means non tiled bo.
v11 check for proper libdrm
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
|
|
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42913 .
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
and actually enable it for M7, previous commit only did one function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
So it appears the M7 family always tiles its depth buffer also.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
When we do the allocations we need to make sure the always tiled
nature is taken into account.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
In particular, handle and propagate failure to allocate GPU accessible memory,
instead of crashing. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=30047 .
Also take care not to leak resources in error paths.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
libvdpau has a driver loading mechanism that looks for a dri2 driver
first before falling back to nvidia, so lets use that.
Allows use of libvdpau_rx00 without having to set things up separately,
similar to the patch to xf86-video-nouveau.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Tested-by: Michel Dänzer <michel@daenzer.net>
|
|
Buffer exchange assumes that the front buffer pixmap and name
information is accurate. That may not be the case eg. if the window
has been (un)redirected since the buffer was created.
Signed-off-by: Ville Syrjala <syrjala@sci.fi>
|
|
Reported-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
|
Base alignment may be 256B or 512B depending on the group
size. Also need to check against front size for virtualX.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
|
improvements to high-crtc handling done in
f0b7d7b449cc77bb2b281d81108507f8bc2e6018 introduced a bug that caused
the populate_vbl_request_type to never use the high-crtc field even
when it should. The reason is that the offending patch put the code
under #ifdef DRM_VBLANK_HIGH_CRTC_MASK which is not visible outside the
enum type, so #else was always taken in compilation type. This patch
fixes it by basing #ifdef on (pre-processor visible)
DRM_VBLANK_HIGH_CRTC_SHIFT constant
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
|
|
* Fix build against libdrm that doesn't define *_VBLANK_HIGH_CRTC*.
* If we have more than two CRTCs but can't use DRM_VBLANK_HIGH_CRTC_MASK, don't
enable scheduling in the first place rather than relying on
DRM_VBLANK_SECONDARY magically doing something sensible for higher CRTCs.
* Only set up client state tracking when scheduling is enabled.
* Only declare pRADEONEnt when it's needed, and break long lines.
|
|
Hi Alex,
Enclosed is a revised version of two patches sent on Mar 18 and Mar 22,
respectively. Details summarized in these two threads:
http://lists.freedesktop.org/archives/dri-devel/2011-March/009463.html
http://lists.freedesktop.org/archives/dri-devel/2011-March/009582.html
This patch reconciles the DDX with the change in libdrm sent to this list
earlier today. Specifically, it refers to a symbol that has been renamed
from DRM_CAP_HIGH_CRTC to DRM_CAP_VBLANK_HIGH_CRTC. It *supersedes* the
previous patch (i.e. apply it to the master branch as it exists at the
time of this writing, not as an incremental patch to the one sent previously).
Regards,
Ilija
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
|
Based on Ben's nouveau patch.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
|
target_msc wasn't passed from vblank event handler
to pageflip routine, due to a missing initalization.
Now fixed.
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
|