This patchset adds TV-out modesetting support to the nouveau DRM driver (I've diff'ed it against the nouveau kernel tree but there are no relevant changes in drm.ko and PATCH 1-4 should apply cleanly against linus' tree). The main issue I was worried about (as we discussed at #dri-devel) was the potential code duplication among different KMS drivers sharing TV encoders (e.g. PATCH 5 adds an implementation for chips like Chrontel ch7006. AFAIK there are also intel, s3 and SiS boards with similar chrontel TV encoders).
With this in mind, PATCH 1 adds some boilerplate to drm.ko to allow detaching an encoder implementation from its main DRM driver: For the case of an encoder connected through an I2C bus, the main DRM driver just needs to call drm_i2c_encoder_init() after allocating the necessary memory, providing some minimal information describing how the I2C encoder is wired up with the GPU. The kernel module containing the encoder driver is then transparently loaded and a struct drm_encoder_slave_funcs is filled with some callbacks similar to the ones in drm_encoder_helper_funcs. The main DRM driver can use them directly to initialize the latter or it can wrap them around to do any GPU-specific initialization (e.g. on DPMS-on some clocks will typically have to be enabled in the GPU). I needed some more encoder variables (slave_funcs, slave_priv, bus_priv) so I defined a new drm_encoder_slave struct "inheriting" from drm_encoder to avoid wasting some bytes on KMS drivers not using them. For anyone interested on testing this: you will also need [7] on the DDX. I obviously don't intend [7] or PATCH 5-6 to be pushed yet, PATCH 5-6 should probably go to the nouveau kernel tree before. I've attempted to keep the interfaces documented in-line, any comments would be appreciated. [7] http://people.freedesktop.org/~currojerez/xf86-video-nouveau_kms-tvout.patch [PATCH 1/6] drm: Slave encoder interface. [PATCH 2/6] drm: Define DRM_MODE_CONNECTOR_TV [PATCH 3/6] drm: Define DRM_MODE_SUBCONNECTOR_SCART [PATCH 4/6] drm: Define some new standard TV properties. [PATCH 5/6] drm: Import driver for the ch7006 I2C TV encoder chip. [PATCH 6/6] drm/nouveau: Import <nv17 TV-out support. drivers/gpu/drm/Kconfig | 14 + drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/drm_crtc.c | 21 ++ drivers/gpu/drm/drm_encoder_slave.c | 119 ++++++++ drivers/gpu/drm/drm_sysfs.c | 3 + drivers/gpu/drm/i2c/Makefile | 3 + drivers/gpu/drm/i2c/ch7006_drv.c | 468 ++++++++++++++++++++++++++++ drivers/gpu/drm/i2c/ch7006_mode.c | 470 +++++++++++++++++++++++++++++ drivers/gpu/drm/i2c/ch7006_priv.h | 332 ++++++++++++++++++++ drivers/gpu/drm/nouveau/Makefile | 2 +- drivers/gpu/drm/nouveau/nouveau_bios.c | 36 ++- drivers/gpu/drm/nouveau/nouveau_drv.h | 14 + drivers/gpu/drm/nouveau/nouveau_encoder.h | 7 +- drivers/gpu/drm/nouveau/nouveau_hw.c | 29 ++ drivers/gpu/drm/nouveau/nouveau_i2c.c | 6 +- drivers/gpu/drm/nouveau/nouveau_i2c.h | 1 + drivers/gpu/drm/nouveau/nv04_crtc.c | 59 +++- drivers/gpu/drm/nouveau/nv04_display.c | 29 ++- drivers/gpu/drm/nouveau/nv04_output.c | 192 ++++++++----- drivers/gpu/drm/nouveau/nv04_tv.c | 264 ++++++++++++++++ drivers/gpu/drm/nouveau/nv50_connector.c | 8 +- drivers/gpu/drm/nouveau/nv50_crtc.c | 2 +- drivers/gpu/drm/nouveau/nv50_dac.c | 18 +- drivers/gpu/drm/nouveau/nv50_sor.c | 18 +- drivers/gpu/drm/nouveau/nvreg.h | 21 ++- include/drm/drm_crtc.h | 3 + include/drm/drm_encoder_slave.h | 155 ++++++++++ include/drm/drm_mode.h | 2 + include/drm/i2c/ch7006.h | 86 ++++++ 29 files changed, 2263 insertions(+), 122 deletions(-) ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
