Commit Graph

2768 Commits

Author SHA1 Message Date
Eric Anholt 8b2d2ff0d0 Clean up more i830_memory.c madness.
It was cooking up insane alignment values for buffers that new libdrm was
justifiably complaining about, but it turns out we don't need the alignment
values anywhere because the only case they're needed, they're computed
entirely by the kernel.  Also, the XVMC code was passing a completely unused
flag in.
2009-10-08 15:34:10 -07:00
Eric Anholt d525a0e993 Rename pScreen to screen. 2009-10-08 15:34:10 -07:00
Eric Anholt b6262dcd27 Rename pGC to gc. 2009-10-08 15:34:10 -07:00
Eric Anholt fdcfeb822d Rename pDraw to plain old drawable. 2009-10-08 15:34:10 -07:00
Eric Anholt 7bbf4ac713 Rename the xv pPriv to adaptor_priv to reflect whose private it is. 2009-10-08 15:34:09 -07:00
Eric Anholt f309d47524 Call pPixmaps plain old pixmaps. 2009-10-08 15:34:09 -07:00
Eric Anholt da0f6616ad de-pCamelHungarian the Render pictures and pixmaps. 2009-10-08 15:34:09 -07:00
Eric Anholt 050a141b7b Share several render fields between render implementations.
Also, start settling on the cairo naming for things: source, mask, and dest.
2009-10-08 15:34:09 -07:00
Eric Anholt af27a3a0a5 Rename the xf86 screen private from pScrn to scrn. 2009-10-08 15:34:09 -07:00
Eric Anholt cc5d3ba3c3 Rename the screen private from I830Ptr pI830 to intel_screen_private *intel.
This is the beginning of the campaign to remove some of the absurd use of
Hungarian in the driver.  Not that I don't like Hungarian, but I don't need
to know that pI830 is a pPointer.
2009-10-08 15:34:09 -07:00
Chris Wilson 03e8e64f86 Complete the removal of UMS build support
Eric missed removing the now dead references to the deleted subdirectories
in configure.ac with commit b9b159c

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-07 22:15:37 +01:00
Eric Anholt 5e44a0fa42 Remove more dead UMS code. 2009-10-06 18:08:51 -07:00
Eric Anholt 6a716a25ab Remove the reg_dumper code, now that it's been moved to intel_gpu_tools. 2009-10-06 17:58:32 -07:00
Eric Anholt e9aff787a5 Remove the stepping debug app, replaced by version in intel_gpu_tools. 2009-10-06 17:55:10 -07:00
Eric Anholt 71b9cdaa86 Trim down the hotplug debug app. 2009-10-06 17:53:21 -07:00
Eric Anholt e95eb483e2 Remove intel_idle, replaced by intel_gpu_top in intel_gpu_tools. 2009-10-06 17:51:58 -07:00
Eric Anholt 8ae0e44e42 Move to kernel coding style.
We've talked about doing this since the start of the project, putting it off
until "some convenient time".  Just after removing a third of the driver seems
like a convenient time, when backporting's probably not happening much anyway.
2009-10-06 17:10:31 -07:00
Eric Anholt b9b159c498 Remove UMS support.
At this point, the only remaining feature regressions should be the lack of
overlay support (about to land), and the need to update the XVMC code to work
in the presence of KMS.

Acked-by: Keith Packard <keithp@keithp.com> (in principle)
Acked-by: Carl Worth <cworth@cworth.org> (in principle)
2009-10-06 16:22:31 -07:00
Eric Anholt d26f4c4937 Remove UMS overlay support.
The replacement code is now landed, and the rest of UMS is about to disappear.
2009-10-05 13:41:39 -07:00
Eric Anholt 33c488e836 Remove error state dumping code.
This is replaced by intel_gpu_dump, and would no longer be used once UMS is
gone.
2009-10-05 13:19:57 -07:00
Daniel Vetter 2370af32fe Implement drmmode overlay
This does not restore the overlay on EnterVT/disable it on LeaveVT.
Does not look like this is necessary.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[anholt: Hacked in avoiding the actual kernel calls with
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:17:47 -07:00
Daniel Vetter 9923086405 Xv: introduce an overlay hal
This is the last preparatory step for overlay support with drmmode.
Safe two (specially marked) function calls in the setup code, all
hw accessing code goes now through these three new functions with
the ums_overlay prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter bb04e184fd Xv: rework overlay buffer management
The basic idea is to only pin the buffer into the gtt when
the overlay hw is actually using it. This results in a few changes:

- Unify data copied/buffer handling with textured video. Now offsets
  are always buffer relative and we just use drm_bo_map to access a
  buffer.
- Implement double buffering using two bo's. This is necessary because
  we can't pin the same buffer to the gtt and map it as normal memory.
- Kill XV_DOUBLE_BUFFER. With the above changes, overlay video is always
  doubel buffered.

There is still the XvMC passthrough case, which makes the code slightly
ugly. Unfortunately we can't get at the bo behind this buffer.

Changes since the last review-round:
- Don't overallocate by a factor of 2.
- Prevent possible use-after-free issue.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter 60462eb5b5 Xv: create xvmc_passthrough helper
This way all thes strange special cases make much more sense.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter 71276dff94 Xv: scrap overlay offscreen pixmap support
The code looks like it's been bitrotting since being copied over
from the i810 driver. Furthermore painting rgb pixmaps with the overlay
engine is in these days of modern compositing X an absolute no-go. And
textured video doesn't support it neither, so its likely never ever
used by applications.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter 99afdf985f Xv: small cleanups in I830PutImage
- scrap unused variable overlay
- scrap an superflous if and attach the code to the preceeding else
- tiny layout fix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter d598456f1f Xv I830PutImage splitup: extract i830_wait_for scanline
Also scrap the unecessary variable sync in I830PutImage and the
accompanying obfuscated logic.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 2ba03fa781 Xv I830PutImage splitup: extract i830_copy_video_data
Just moves the code and passes back allocation failures.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 81fc74cc4c Xv I830PutImage splitup: extract i830_setup_video_buffer
Just move the code and pass back allocation failures.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 0bf4cc5130 Xv I830PutImage splitup: extract i830_dst_pitch_and_size
Just moves the code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter c20ef59193 Xv: kill destId in I830PutImage
It's only used to remember that XvMC has ỲV12 as output. is_planar_fourcc
already takes care of that in all necessary cases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 5ce944994d Xv: kill hw double buffering logic
The idea for the hw double buffering support is to program two fixed
buffers and then only switch buffers in the OCMD register. But the driver
as-is always programs the new buffer address (in both register sets
when double buffered). Therefore we gain nothing by using this hw
capability. Scrap the software support for it.

When double buffered, we now allocate just a buffer of size 2*size and
switch between the two parts purely in software.

To make reviewing this easier, I'll shortly explain the differences of how
double-buffering (i.e. tear-free video) is achieved before and after this
change:

- When double buffer, allocate a buffer twice the size (unchanged).
- Depending upon the currently shown buffer-half, copy the new frame into
  the other buffer-half. In the old code this is done by using the right
  set of buffer offsets, either *Buf0Offset or *Buf1Offset. The new code
  simply programs the offset for the right buffer-half into the single set
  of offsets. The end-result is unchanged.

Now the big difference in hw-programming:

Old: Programm new buffer offset into both sets of _hw_ buffer offset
registers. Depending upon the current _sw_ buffer, select the _hw_ buffer
and program this into the OCMD register. This just complicates matters
unnecessarly.

New: Just always use the hw buffer 0.

And then it's again the same story in both old and new code:

- Execute an overlay flip (MI_OVERLAY_FLIP) to read in the contents of the
  hw registers into the shadow hw registers (which are actually being used
  by the overlay, not the ones we write stuff into). This is synchronized
  with the respective crtc vblank by the hw.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 232418d72e Xv: use is_planar_fourcc helper some more
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 219b14310e Xv: introduce planar memcpy helper
Reduced 3 copies of the same code to one.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter b90171f166 Xv: rename i830_display_video to i830_display_overlay
This function only programs the overlay and is never called for textured
video. Make this obvious.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 857e40a6e0 Xv i830_display_video splitup: extract i830_overlay_cmd
This slightly moves around (and simplifies) the OSTRIDE reg programming,
too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 50d70e644e Xv i830_display_video splitup: extract i830_calc_src_regs
Also introduce an is_planar_fourcc helper. I'll use that one later.

In i830_display_video this changeset moves the XVMC case (previously
obscured as the default case) around. I've figured this default case
does not make sense, here's why:

XvMC is everywhere else handled as a planar format (e.g. in the register
programming a few lines down). Furthermore the id variable gets mapped
to FOURCC_YV12 if IS_I915(pI830) is true in I830PutImage. There's a
second caller in the offscreen overlay support code.  But I think that
code is bitrotten and not reliable as an information source.

So we have a different behaviour only for id=FOURCC_XVMC and i965 class
hw (i830 class doesn't have xvmc). I've crawled through various
sources/intel documentations. Finally in the textured video implemention
for i965 class hw (src/i965_video.c) I've found a switch statement that
puts XVMC into the same case as I420 and YV12. So also in i965 class hw
xvmc uses a planar format.

In conclusion I claim that this code was bogus and XvMC on i965 class hw
over Xv overlay was most likely broken.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Carl Worth 2841a4cd8c Increment version to 2.9.0
And add a reminder to RELEASING that the incremented version number
needs to be committed, (since I forgot to do this with 2.8.99.902).
2009-09-28 20:03:39 -07:00
Carl Worth a790aff4fe NEWS: Add notes for the 2.9.0 release.
Just renamed notes as from 2.8.99.902.
2009-09-28 20:02:28 -07:00
Carl Worth a92bbcc949 Increment version to 2.8.99.902 2009-09-22 17:08:23 -07:00
Carl Worth ae00a09237 NEWS: Add notes for 2.8.99.902 2009-09-22 15:14:38 -07:00
Matthias Hopf 7e7db7ac53 Add new backlight driver "samsung". 2009-09-22 17:47:14 +02:00
Zhao Yakui 7ae1d0dde6 Skip setting tv format property if output crtc is NULL
When TV is not connected and X start, after plugging TV cable again,
system will crash because output crtc is NULL. This patch will return,
do not handle crtc immediately, meanwhile set value will be effective
until user really enable output by xrandr command.

Signed-off-by: Ma Ling <ling.ma@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-09-22 10:59:00 +08:00
Zhao Yakui 02fe9be695 Check whether the DVI-I/D is connected or disconnected based on EDID
When the monitor is digital type for SDVO-DVI D, there should exist the EDID. If
there is no EDID, it should be detected as disconnected.

Signe-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-09-22 10:58:38 +08:00
Chris Wilson 762e406d13 Revert "8xx: Fallback for any non-affine transformation."
This reverts commit 505025053d.

In theory, the non-affine paths work -- at least for the stated test case,
so re-enable them and avoid the slow work-around.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-22 01:36:09 +01:00
Keith Packard 2cc1f3cb60 i8xx: Format projective texture coordinates correctly.
Projective texture coordinates must be delivered as TEXCOORDFMT_3D
using TEXCOORDTYPE_HOMOGENOUS. This meant selecting the correct type
in i830_texture_setup, the correct format in i830_emit_composite_state
and sending only 3 coordinates in i830_emit_composite_primitive.

Signed-off-by: Keith Packard <keithp@keithp.com>
[ickle: tweaked to fix up a couple of use-before-initialised]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-22 01:30:59 +01:00
Chris Wilson 00e8de212b Check the correct Picture for error during creation. 2009-09-22 01:27:25 +01:00
Keith Packard bd817e2d73 Split i915/i830 composite_emit_primitive into two functions.
The i915 and i830 take similar but different data when emitting the
primitives, instead of trying to share code here, just split this
apart and avoid potentially breaking things later on.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21 17:24:11 -07:00
Keith Packard 5e80297d08 Remove DGA support from the driver.
The xf86DiDGA code required that the scanout buffer always be
mappable, stay be at a fixed address in the aperture and have a
constant size. With frame buffer resizing, the latter two are no
longer true, and with KMS, we'd really prefer to not allow the former.

The only option available to the driver is to completely disable DGA
as the modes code has internal calls to the xf86DiDGA code when
fetching new modes from the hardware.

A fix for the DiDGA code will be added to the X server which will
automatically initialize DGA for mode switching and input, but not
frame buffer access, and not require any driver cooperation.

Thus, the correct solution is for the driver to not call xf86DiDGAInit
at all. For old servers, this eliminates a potential catastrophic
problem where random memory is written by the X server. New servers
will get the DIX-based behaviour automatically.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21 17:24:11 -07:00
Keith Packard 4758311842 Remove vestigial internal rotation which broke KMS DGA/VidMode modesetting.
Pre-2.0, the driver supported rotation internally, rather than relying
on the X server rotation support. The last piece of this dealt with
rotating the mouse coordinates and also tried to preserve rotation
across DGA/VidModeExtension modesetting requests.

That latter bit of code broke under KMS as the rotation value was
never initialized, and when set to zero would create an invalid
configuration. This would confuse xrandr which would bail before
making any changes, leaving the user without a way to recover.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21 17:24:11 -07:00