Commit Graph

67 Commits (c9cda51af5a8bea1d30ce575ae260de52950fe2f)

Author SHA1 Message Date
Dave Airlie c9cda51af5 more WIP on blobs..
I'm going to pass back a list of blob ids and lengths in the getproperty.
will need another ioctl to return the blob data as it is variable length.
2007-12-05 16:31:35 +10:00
Dave Airlie 1a6c95ef71 arrgggh.. make all ioctl structs 32/64-bit compatible hopefully.
This also starts to add blob property support.

someone needs to check this work for other things like ppc/x86 alignment diffs
2007-12-05 16:03:05 +10:00
Dave Airlie 96df9b11ad finish of mode add/remove, just have attach/detach modes 2007-12-03 15:30:05 +10:00
Dave Airlie 91cd3e3c09 modesetting API change for removing mode ids and making modes per output.
so really want to get a list of modes per output not the global hammer list.
also we remove the mode ids and let the user pass back the full mode description

need to fix up add/remove mode for user modes now
2007-12-03 15:30:05 +10:00
Dave Airlie b3af2b59a7 drm/modesetting: add initial gettable properites code.
This allow the user to retrieve a list of properties for an output.
Properties can either be 32-bit values or an enum with an associated name.
Range properties are to be supported.

This API is probably not all correct, I may make properties part of the general
resource get when I think about it some more.

So basically you can create properties and attached them to whatever outputs you want,
so it should be possible to create some generics and just attach them to every output.
2007-11-27 14:31:02 +10:00
Dave Airlie f9ac54b031 fb: make fb interface use user mode attach/detach for adding modes 2007-11-26 15:06:42 +11:00
Dave Airlie 362f428320 add _ioctl to the end of two more ioctls 2007-11-26 14:28:48 +11:00
Dave Airlie 53b4e0cb78 drm: make fb modes use usermode add/remove interface
this stops usermode from getting a mode in the crtc it can't make sense off.
2007-11-26 14:05:49 +11:00
Jesse Barnes 96e136c479 Fix typo in copy_to_user calls
We want to copy to card_res->modes + copied, not &card_res->modes + copied.
2007-11-16 13:57:42 -08:00
Jesse Barnes 7ec4ebe95e Use user copy routines for writing modes & ids back to userspace
Since the drm_mode_card_res structure contains user pointers, we have to use
put_user and copy_to_user to write stuff out.  The DRM ioctl wrapper will only
take care of copying the base drm_mode_card_res struct, not the included
arrays.
2007-11-15 17:14:03 -08:00
Dave Airlie 1e8984a367 drm: send correct fb id to userspace 2007-11-15 18:31:23 +11:00
Dave Airlie 2520d3fd99 modes: pass type to userspace for preferred showing 2007-11-15 16:52:04 +11:00
Alan Hourihane 71385d6f75 add missing lock 2007-11-05 10:03:26 +00:00
Alan Hourihane 198170ab97 Need fb attached 2007-10-23 15:33:20 +01:00
Alan Hourihane cc9be8ac32 Fix some buffer teardown problems. 2007-10-15 11:51:19 +01:00
Alan Hourihane dfcf9272ce no need to copy to/from user as the unlocked ioctl does
that for us.

other small cleanups.
2007-09-26 15:40:40 +01:00
Jesse Barnes 5cc3083179 Merge branch 'master' into modesetting-101 - TTM & typedef removal
Conflicts:

	linux-core/drmP.h
	linux-core/drm_bo.c
	linux-core/drm_drv.c
	linux-core/drm_objects.h
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c

Mostly removing typedefs that snuck into the modesetting code and
updating to the latest TTM APIs.  As of today, the i915 driver builds,
but there are likely to be problems, so debugging and bugfixes will
come next.
2007-09-24 14:41:46 -07:00
Jakob Bornecrantz 9ccb8440f3 Changed mode config spinlock to mutex 2007-07-20 11:36:57 +02:00
Jakob Bornecrantz 43c9abdedc Fix unlocking of spinlock when we should not 2007-07-19 16:58:23 +02:00
Alan Hourihane 14c49df06b merge fixes 2007-06-29 20:14:09 +01:00
Alan Hourihane e79e2a5816 Fix type/flags usage problem to check for preferred modes.
Add more debugging to help diagnose problems.
2007-06-28 21:25:13 +01:00
Jesse Barnes a4929b921e Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts:

	linux-core/drm_crtc.c - reconcile with locking changes
2007-05-18 09:42:51 -07:00
Jesse Barnes f894587221 Add locking. The main lock is dev->mode_config.config_lock. It should be
held across any operations that modify mode lists, crtc config, output
config, etc.  It should be taken at high level entry points (currently just
initial config and user IOCTL).

Seems to work ok on my system, but needs more testing (with lockdep) and
review from some fresh eyes.
2007-05-18 09:40:01 -07:00
Alan Hourihane 0c33a2cd2e Move fbo creation to the specified fb driver which gives
it a chance to allocate the memory from whichever buffer it wants to.
2007-05-18 14:16:10 +01:00
Alan Hourihane 07a5fbaa61 Move destruction of crtc as intelfb_remove uses the crtc to locate the fb. 2007-05-17 19:28:03 +01:00
Jesse Barnes b7bf317f42 Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts:

	linux-core/drm_crtc.c
	linux-core/drm_fb.c

Lots of changes to merge with alanh's latest stuff:
  o fix use of fb->pitch now that it has the right value
  o add new helper for finding the CRTC given an FB
  o fix new fb_probe/fb_remove functions to take a CRTC
  o fixup callers of new FB routines
  o port drm_fb changes to intel_fb
  o check for errors after creating fb buffer object
  o go back to using cfb_imageblit since the accel stubs aren't ready
2007-05-17 10:35:07 -07:00
Alan Hourihane fd63ea9713 Grab the default mode if the preferred mode isn't available.
Fix an overflow problem.
2007-05-17 17:00:11 +01:00
Jesse Barnes a18b4befb9 Fix FB pitch value (we had it wrong and were working around it in a few
places).
Add new FB hooks to the drm driver structure and make i915 use them for an
Intel specific FB driver.  This will allow acceleration and better handling
of the command stream.
2007-05-17 09:00:06 -07:00
root 5ce8aaae72 Large changes for fbdev support.
Change from DIRECTCOLOR to TRUECOLOR, and enable
support for PSEUDOCOLOR. DIRECTCOLOR support needs more work.

Add the ability to change the mode on the fbdev device.

Support depth 8, 15, 16 and 24 (and 32).

Add a /dev/fbX device per CRTC, but there's some code which
doesn't allocate the fbX device unless the output is actually
enabled. Read the code on this as it impacts the fbcon map flags.

Pick CRTC's based on the available outputs. More work could
be done here to match modes, so cloning could be achieved on
outputs. This fits more inline with what the X code does.
2007-05-17 12:46:36 +01:00
Dave Airlie 3a69e2484a cleanup usermodes on drm mode setting shutdown 2007-05-01 14:20:22 +10:00
Dave Airlie 89231953d1 Add support for user defined modes
This allows userspace to specify modes and add them to the modesetting
system and attach modes to outputs
2007-05-01 13:16:29 +10:00
Dave Airlie ceb44021ad drm: make mode numbers no change by comparing probed modes
The mode list sets all the output modes to UNVERIFIED, then probes a new list,
If a mode is on the new list and not on the old, it adds it to the old,
if a mode is on the new list and old, it just updates the status to the new
mode status.
If a mode is on the old list and not on the new, prune invalid modes should
remove all UNVERIFIED modes
2007-04-23 11:42:29 +10:00
Dave Airlie 0f3c5148f0 fixup vrefresh reporting, it should now be *1000 in userspace 2007-04-23 09:10:46 +10:00
Jesse Barnes 5587961cfe Document main drm_crtc.c functions, and rename drm_crtc_mode_create to
drm_mode_create to be consistent with the other functions.  Also document
where we need locking fixes and what the locks are for.
2007-04-18 11:49:42 -07:00
Alan Hourihane dfc02547ff Shouldn't free the mode here. It's done later on. 2007-04-18 14:18:56 +01:00
Alan Hourihane 0207b51acc Fix build problem 2007-04-18 12:19:16 +01:00
Alan Hourihane 87b46bd436 free the duplicated mode. 2007-04-18 12:10:06 +01:00
Alan Hourihane 191594ebd5 When no valid EDID modes are available, we bail.
This snippet adds a standard 640x480 @ 60Hz mode when
that occurs, so we can continue with a basic mode.

Should we do this here though ???
2007-04-18 12:07:55 +01:00
Dave Airlie 20b2949e37 make sure TMDS gets a crtc 2007-04-18 14:55:43 +10:00
Dave Airlie d20aaf4858 don't crash if no desired mode 2007-04-18 10:41:39 +10:00
Jesse Barnes 73b031df61 Add framebuffer bo freeing to drm_mode_config_cleanup (seems like the best
place for now).
2007-04-17 17:30:46 -07:00
Jesse Barnes 1c7f895fa6 Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts:

	shared-core/i915_init.c - reconcile with airlied's new code
2007-04-17 10:14:18 -07:00
Jesse Barnes 4e4d9cbeb3 Move initial framebuffer allocation and configuration to drm_initial_config,
remove i915_driver_load fb related stuff.  Add a small helper for setting up
outputs.
2007-04-17 10:00:37 -07:00
Dave Airlie 79aa1d5474 another large overhaul of interactions with userspace...
We need to keep a list of user created fbs to nuke on master exit.
We also need to use the bo properly.
2007-04-17 18:16:38 +10:00
Jakob Bornecrantz c4e944182d Added debug messages so we know which output we are dealing with 2007-04-13 10:13:25 +02:00
Alan Hourihane cf01689143 Use drm_framebuffer instead of drm_crtc for fb & fbt 2007-04-12 15:12:00 +01:00
Dave Airlie 1bba3cb3b3 cleanup framebuffers on drm unload 2007-04-12 11:55:10 +10:00
Dave Airlie b49b3ba4c1 set bracing style like Linux 2007-04-12 11:43:13 +10:00
Dave Airlie a5cf4cc369 fix unbalanced lock and make sure mode list has modes so lvds code doesn't crash 2007-04-12 11:28:55 +10:00
Dave Airlie 981f8156de allow framebuffer changes on the crtc setup 2007-04-12 08:54:31 +10:00