Skip to contentSkip to conversation

gma500: Intel GMA500 staging driver

PATCH In review Alan Cox 7 participants 12 messages Feb 22, 2011 – Mar 1, 2011 Staging

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 gma500: Intel GMA500 staging driver

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

There is no support for the parts without open source userspace (video accelerators, 3D) as per kernel policy.

I'm not a DRM expert so if there is anyone with a GMA500 who actually knows something about DRI internals then help would be most welcome.

---

 drivers/staging/Kconfig                         |    2 
 drivers/staging/Makefile                        |    9 
 drivers/staging/gma500/Kconfig                  |   12 
 drivers/staging/gma500/Makefile                 |   30 
 drivers/staging/gma500/psb_bl.c                 |  167 ++
 drivers/staging/gma500/psb_buffer.c             |  450 ++++++
 drivers/staging/gma500/psb_drm.h                |  696 ++++++++++
 drivers/staging/gma500/psb_drv.c                | 1677 +++++++++++++++++++++++
 drivers/staging/gma500/psb_drv.h                | 1139 ++++++++++++++++
 drivers/staging/gma500/psb_fb.c                 |  840 ++++++++++++
 drivers/staging/gma500/psb_fb.h                 |   59 +
 drivers/staging/gma500/psb_fence.c              |  122 ++
 drivers/staging/gma500/psb_gfx.mod.c            |   27 
 drivers/staging/gma500/psb_gtt.c                | 1034 ++++++++++++++
 drivers/staging/gma500/psb_gtt.h                |  105 +
 drivers/staging/gma500/psb_intel_bios.c         |  301 ++++
 drivers/staging/gma500/psb_intel_bios.h         |  430 ++++++
 drivers/staging/gma500/psb_intel_display.c      | 1489 ++++++++++++++++++++
 drivers/staging/gma500/psb_intel_display.h      |   25 
 drivers/staging/gma500/psb_intel_drv.h          |  247 +++
 drivers/staging/gma500/psb_intel_i2c.c          |  169 ++
 drivers/staging/gma500/psb_intel_lvds.c         |  889 ++++++++++++
 drivers/staging/gma500/psb_intel_modes.c        |   77 +
 drivers/staging/gma500/psb_intel_opregion.c     |   78 +
 drivers/staging/gma500/psb_intel_reg.h          | 1200 ++++++++++++++++
 drivers/staging/gma500/psb_intel_sdvo.c         | 1298 ++++++++++++++++++
 drivers/staging/gma500/psb_intel_sdvo_regs.h    |  338 +++++
 drivers/staging/gma500/psb_irq.c                |  637 +++++++++
 drivers/staging/gma500/psb_irq.h                |   49 +
 drivers/staging/gma500/psb_mmu.c                |  919 +++++++++++++
 drivers/staging/gma500/psb_powermgmt.c          |  797 +++++++++++
 drivers/staging/gma500/psb_powermgmt.h          |   96 +
 drivers/staging/gma500/psb_pvr_glue.c           |   73 +
 drivers/staging/gma500/psb_pvr_glue.h           |   25 
 drivers/staging/gma500/psb_reg.h                |  588 ++++++++
 drivers/staging/gma500/psb_reset.c              |   90 +
 drivers/staging/gma500/psb_sgx.c                |  238 +++
 drivers/staging/gma500/psb_sgx.h                |   32 
 drivers/staging/gma500/psb_ttm_fence.c          |  605 ++++++++
 drivers/staging/gma500/psb_ttm_fence_api.h      |  272 ++++
 drivers/staging/gma500/psb_ttm_fence_driver.h   |  302 ++++
 drivers/staging/gma500/psb_ttm_fence_user.c     |  237 +++
 drivers/staging/gma500/psb_ttm_fence_user.h     |  140 ++
 drivers/staging/gma500/psb_ttm_glue.c           |  349 +++++
 drivers/staging/gma500/psb_ttm_placement_user.c |  628 +++++++++
 drivers/staging/gma500/psb_ttm_placement_user.h |  252 +++
 drivers/staging/gma500/psb_ttm_userobj_api.h    |   85 +
 47 files changed, 19320 insertions(+), 4 deletions(-)
 create mode 100644 drivers/staging/gma500/Kconfig
 create mode 100644 drivers/staging/gma500/Makefile
 create mode 100644 drivers/staging/gma500/psb_bl.c
 create mode 100644 drivers/staging/gma500/psb_buffer.c
 create mode 100644 drivers/staging/gma500/psb_drm.h
 create mode 100644 drivers/staging/gma500/psb_drv.c
 create mode 100644 drivers/staging/gma500/psb_drv.h
 create mode 100644 drivers/staging/gma500/psb_fb.c
 create mode 100644 drivers/staging/gma500/psb_fb.h
 create mode 100644 drivers/staging/gma500/psb_fence.c
 create mode 100644 drivers/staging/gma500/psb_gfx.mod.c
 create mode 100644 drivers/staging/gma500/psb_gtt.c
 create mode 100644 drivers/staging/gma500/psb_gtt.h
 create mode 100644 drivers/staging/gma500/psb_intel_bios.c
 create mode 100644 drivers/staging/gma500/psb_intel_bios.h
 create mode 100644 drivers/staging/gma500/psb_intel_display.c
 create mode 100644 drivers/staging/gma500/psb_intel_display.h
 create mode 100644 drivers/staging/gma500/psb_intel_drv.h
 create mode 100644 drivers/staging/gma500/psb_intel_i2c.c
 create mode 100644 drivers/staging/gma500/psb_intel_lvds.c
 create mode 100644 drivers/staging/gma500/psb_intel_modes.c
 create mode 100644 drivers/staging/gma500/psb_intel_opregion.c
 create mode 100644 drivers/staging/gma500/psb_intel_reg.h
 create mode 100644 drivers/staging/gma500/psb_intel_sdvo.c
 create mode 100644 drivers/staging/gma500/psb_intel_sdvo_regs.h
 create mode 100644 drivers/staging/gma500/psb_irq.c
 create mode 100644 drivers/staging/gma500/psb_irq.h
 create mode 100644 drivers/staging/gma500/psb_mmu.c
 create mode 100644 drivers/staging/gma500/psb_powermgmt.c
 create mode 100644 drivers/staging/gma500/psb_powermgmt.h
 create mode 100644 drivers/staging/gma500/psb_pvr_glue.c
 create mode 100644 drivers/staging/gma500/psb_pvr_glue.h
 create mode 100644 drivers/staging/gma500/psb_reg.h
 create mode 100644 drivers/staging/gma500/psb_reset.c
 create mode 100644 drivers/staging/gma500/psb_sgx.c
 create mode 100644 drivers/staging/gma500/psb_sgx.h
 create mode 100644 drivers/staging/gma500/psb_ttm_fence.c
 create mode 100644 drivers/staging/gma500/psb_ttm_fence_api.h
 create mode 100644 drivers/staging/gma500/psb_ttm_fence_driver.h
 create mode 100644 drivers/staging/gma500/psb_ttm_fence_user.c
 create mode 100644 drivers/staging/gma500/psb_ttm_fence_user.h
 create mode 100644 drivers/staging/gma500/psb_ttm_glue.c
 create mode 100644 drivers/staging/gma500/psb_ttm_placement_user.c
 create mode 100644 drivers/staging/gma500/psb_ttm_placement_user.h
 create mode 100644 drivers/staging/gma500/psb_ttm_userobj_api.h
drivers/staging/Kconfig +2 -0
index 8da4531..1da2ce2 100644
@@ -192,5 +192,7 @@ source "drivers/staging/cptm1217/Kconfig"
 
 source "drivers/staging/ste_rmi4/Kconfig"
 
+source "drivers/staging/gma500/Kconfig"
+
 endif # !STAGING_EXCLUDE_BUILD
 endif # STAGING
drivers/staging/Makefile +5 -4
index 35704b4..ab38da6 100644
@@ -62,12 +62,13 @@ obj-$(CONFIG_SOLO6X10)		+= solo6x10/
 obj-$(CONFIG_TIDSPBRIDGE)	+= tidspbridge/
 obj-$(CONFIG_ACPI_QUICKSTART)	+= quickstart/
 obj-$(CONFIG_WESTBRIDGE_ASTORIA)	+= westbridge/astoria/
-obj-$(CONFIG_SBE_2T3E3)	+= sbe-2t3e3/
+obj-$(CONFIG_SBE_2T3E3)		+= sbe-2t3e3/
 obj-$(CONFIG_ATH6K_LEGACY)	+= ath6kl/
 obj-$(CONFIG_USB_ENESTORAGE)	+= keucr/
-obj-$(CONFIG_BCM_WIMAX)	+= bcm/
+obj-$(CONFIG_BCM_WIMAX)		+= bcm/
 obj-$(CONFIG_FT1000)		+= ft1000/
-obj-$(CONFIG_SND_INTEL_SST)		+= intel_sst/
-obj-$(CONFIG_SPEAKUP)	+= speakup/
+obj-$(CONFIG_SND_INTEL_SST)	+= intel_sst/
+obj-$(CONFIG_SPEAKUP)		+= speakup/
 obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217)	+= cptm1217/
 obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)	+= ste_rmi4/
+obj-$(CONFIG_DRM_PSB)		+= gma500/
drivers/staging/gma500/Kconfig new file +12 -0
new file mode 100644
index 0000000..5501eb9
@@ -0,0 +1,12 @@
+config DRM_PSB
+	tristate "Intel GMA500 KMS Framebuffer"
+	depends on DRM && PCI
+	select FB_CFB_COPYAREA
+        select FB_CFB_FILLRECT
+        select FB_CFB_IMAGEBLIT
+        select DRM_KMS_HELPER
+        select DRM_TTM
+	help
+	  Say yes for an experimental KMS framebuffer driver for the
+	  Intel GMA500 ('Poulsbo') graphics support.
+
drivers/staging/gma500/Makefile new file +30 -0
new file mode 100644
index 0000000..21381eb
@@ -0,0 +1,30 @@
+#
+#	KMS driver for the GMA500
+#
+ccflags-y += -Iinclude/drm
+
+psb_gfx-y += psb_bl.o \
+	  psb_drv.o \
+	  psb_fb.o \
+	  psb_gtt.o \
+	  psb_intel_bios.o \
+	  psb_intel_opregion.o \
+	  psb_intel_display.o \
+	  psb_intel_i2c.o \
+	  psb_intel_lvds.o \
+	  psb_intel_modes.o \
+	  psb_intel_sdvo.o \
+	  psb_reset.o \
+	  psb_sgx.o \
+	  psb_pvr_glue.o \
+	  psb_buffer.o \
+	  psb_fence.o \
+	  psb_mmu.o \
+	  psb_ttm_glue.o \
+	  psb_ttm_fence.o \
+	  psb_ttm_fence_user.o \
+	  psb_ttm_placement_user.o \
+	  psb_powermgmt.o \
+	  psb_irq.o
+
+obj-$(CONFIG_DRM_PSB) += psb_gfx.o
drivers/staging/gma500/psb_bl.c new file +167 -0

167 lines not on this page · raw message

drivers/staging/gma500/psb_buffer.c new file +450 -0

450 lines not on this page · raw message

drivers/staging/gma500/psb_drm.h new file +696 -0

696 lines not on this page · raw message

drivers/staging/gma500/psb_drv.c new file +1677 -0

1,621 lines not on this page · raw message

drivers/staging/gma500/psb_drv.h new file +1139 -0

1,139 lines not on this page · raw message

drivers/staging/gma500/psb_fb.c new file +840 -0

840 lines not on this page · raw message

drivers/staging/gma500/psb_fb.h new file +59 -0

59 lines not on this page · raw message

drivers/staging/gma500/psb_fence.c new file +122 -0

122 lines not on this page · raw message

drivers/staging/gma500/psb_gfx.mod.c new file +27 -0
new file mode 100644
index 0000000..1a663ab

Lines of this file are not shown. View the raw message.

drivers/staging/gma500/psb_gtt.c new file +1034 -0

1,034 lines not on this page · raw message

drivers/staging/gma500/psb_gtt.h new file +105 -0

105 lines not on this page · raw message

drivers/staging/gma500/psb_intel_bios.c new file +301 -0

301 lines not on this page · raw message

drivers/staging/gma500/psb_intel_bios.h new file +430 -0

430 lines not on this page · raw message

drivers/staging/gma500/psb_intel_display.c new file +1489 -0

1,489 lines not on this page · raw message

drivers/staging/gma500/psb_intel_display.h new file +25 -0
new file mode 100644
index 0000000..74e3b5e

Lines of this file are not shown. View the raw message.

drivers/staging/gma500/psb_intel_drv.h new file +247 -0

247 lines not on this page · raw message

drivers/staging/gma500/psb_intel_i2c.c new file +169 -0

169 lines not on this page · raw message

drivers/staging/gma500/psb_intel_lvds.c new file +889 -0

889 lines not on this page · raw message

drivers/staging/gma500/psb_intel_modes.c new file +77 -0

77 lines not on this page · raw message

drivers/staging/gma500/psb_intel_opregion.c new file +78 -0

78 lines not on this page · raw message

drivers/staging/gma500/psb_intel_reg.h new file +1200 -0

1,200 lines not on this page · raw message

drivers/staging/gma500/psb_intel_sdvo.c new file +1298 -0

1,298 lines not on this page · raw message

drivers/staging/gma500/psb_intel_sdvo_regs.h new file +338 -0

338 lines not on this page · raw message

drivers/staging/gma500/psb_irq.c new file +637 -0

637 lines not on this page · raw message

drivers/staging/gma500/psb_irq.h new file +49 -0

49 lines not on this page · raw message

drivers/staging/gma500/psb_mmu.c new file +919 -0

919 lines not on this page · raw message

drivers/staging/gma500/psb_powermgmt.c new file +797 -0

797 lines not on this page · raw message

drivers/staging/gma500/psb_powermgmt.h new file +96 -0

96 lines not on this page · raw message

drivers/staging/gma500/psb_pvr_glue.c new file +73 -0

73 lines not on this page · raw message

drivers/staging/gma500/psb_pvr_glue.h new file +25 -0
new file mode 100644
index 0000000..63dd094

Lines of this file are not shown. View the raw message.

drivers/staging/gma500/psb_reg.h new file +588 -0

588 lines not on this page · raw message

drivers/staging/gma500/psb_reset.c new file +90 -0

90 lines not on this page · raw message

drivers/staging/gma500/psb_sgx.c new file +238 -0

238 lines not on this page · raw message

drivers/staging/gma500/psb_sgx.h new file +32 -0
new file mode 100644
index 0000000..2934e5d

Lines of this file are not shown. View the raw message.

drivers/staging/gma500/psb_ttm_fence.c new file +605 -0

605 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_fence_api.h new file +272 -0

272 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_fence_driver.h new file +302 -0

302 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_fence_user.c new file +237 -0

237 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_fence_user.h new file +140 -0

140 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_glue.c new file +349 -0

349 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_placement_user.c new file +628 -0

628 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_placement_user.h new file +252 -0

252 lines not on this page · raw message

drivers/staging/gma500/psb_ttm_userobj_api.h new file +85 -0

85 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 3 lines · Alan Cox

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Nice!

Quoted 2 lines

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

So that's all that is needed on the userspace side? Or is there a driver for X that also goes along with this patch that is available somewhere?

Quoted 53 lines

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

There is no support for the parts without open source userspace (video accelerators, 3D) as per kernel policy.

I'm not a DRM expert so if there is anyone with a GMA500 who actually knows something about DRI internals then help would be most welcome.

---

 drivers/staging/Kconfig                         |    2 
 drivers/staging/Makefile                        |    9 
 drivers/staging/gma500/Kconfig                  |   12 
 drivers/staging/gma500/Makefile                 |   30 
 drivers/staging/gma500/psb_bl.c                 |  167 ++
 drivers/staging/gma500/psb_buffer.c             |  450 ++++++
 drivers/staging/gma500/psb_drm.h                |  696 ++++++++++
 drivers/staging/gma500/psb_drv.c                | 1677 +++++++++++++++++++++++
 drivers/staging/gma500/psb_drv.h                | 1139 ++++++++++++++++
 drivers/staging/gma500/psb_fb.c                 |  840 ++++++++++++
 drivers/staging/gma500/psb_fb.h                 |   59 +
 drivers/staging/gma500/psb_fence.c              |  122 ++
 drivers/staging/gma500/psb_gfx.mod.c            |   27 
 drivers/staging/gma500/psb_gtt.c                | 1034 ++++++++++++++
 drivers/staging/gma500/psb_gtt.h                |  105 +
 drivers/staging/gma500/psb_intel_bios.c         |  301 ++++
 drivers/staging/gma500/psb_intel_bios.h         |  430 ++++++
 drivers/staging/gma500/psb_intel_display.c      | 1489 ++++++++++++++++++++
 drivers/staging/gma500/psb_intel_display.h      |   25 
 drivers/staging/gma500/psb_intel_drv.h          |  247 +++
 drivers/staging/gma500/psb_intel_i2c.c          |  169 ++
 drivers/staging/gma500/psb_intel_lvds.c         |  889 ++++++++++++
 drivers/staging/gma500/psb_intel_modes.c        |   77 +
 drivers/staging/gma500/psb_intel_opregion.c     |   78 +
 drivers/staging/gma500/psb_intel_reg.h          | 1200 ++++++++++++++++
 drivers/staging/gma500/psb_intel_sdvo.c         | 1298 ++++++++++++++++++
 drivers/staging/gma500/psb_intel_sdvo_regs.h    |  338 +++++
 drivers/staging/gma500/psb_irq.c                |  637 +++++++++
 drivers/staging/gma500/psb_irq.h                |   49 +
 drivers/staging/gma500/psb_mmu.c                |  919 +++++++++++++
 drivers/staging/gma500/psb_powermgmt.c          |  797 +++++++++++
 drivers/staging/gma500/psb_powermgmt.h          |   96 +
 drivers/staging/gma500/psb_pvr_glue.c           |   73 +
 drivers/staging/gma500/psb_pvr_glue.h           |   25 
 drivers/staging/gma500/psb_reg.h                |  588 ++++++++
 drivers/staging/gma500/psb_reset.c              |   90 +
 drivers/staging/gma500/psb_sgx.c                |  238 +++
 drivers/staging/gma500/psb_sgx.h                |   32 
 drivers/staging/gma500/psb_ttm_fence.c          |  605 ++++++++
 drivers/staging/gma500/psb_ttm_fence_api.h      |  272 ++++
Quoted 8 lines
 drivers/staging/gma500/psb_ttm_fence_driver.h   |  302 ++++
 drivers/staging/gma500/psb_ttm_fence_user.c     |  237 +++
 drivers/staging/gma500/psb_ttm_fence_user.h     |  140 ++
 drivers/staging/gma500/psb_ttm_glue.c           |  349 +++++
 drivers/staging/gma500/psb_ttm_placement_user.c |  628 +++++++++
 drivers/staging/gma500/psb_ttm_placement_user.h |  252 +++
 drivers/staging/gma500/psb_ttm_userobj_api.h    |   85 +
 47 files changed, 19320 insertions(+), 4 deletions(-)

Can I also get a TODO file for this directory that lists what needs to be done to move it out of the staging tree, as well as an email to contact for patches and questions?

Quoted 10 lines
drivers/staging/Makefile +1 -1
@@ -62,12 +62,13 @@ obj-$(CONFIG_SOLO6X10)		+= solo6x10/
 obj-$(CONFIG_TIDSPBRIDGE)	+= tidspbridge/
 obj-$(CONFIG_ACPI_QUICKSTART)	+= quickstart/
 obj-$(CONFIG_WESTBRIDGE_ASTORIA)	+= westbridge/astoria/
-obj-$(CONFIG_SBE_2T3E3)	+= sbe-2t3e3/
+obj-$(CONFIG_SBE_2T3E3)		+= sbe-2t3e3/
 obj-$(CONFIG_ATH6K_LEGACY)	+= ath6kl/
 obj-$(CONFIG_USB_ENESTORAGE)	+= keucr/

drivers/staging/Makefile obj-$(CONFIG_SOLO6X10) += solo6x10/ · line 74

Quoted 10 lines
drivers/staging/Makefile +4 -3
-obj-$(CONFIG_BCM_WIMAX)	+= bcm/
+obj-$(CONFIG_BCM_WIMAX)		+= bcm/
 obj-$(CONFIG_FT1000)		+= ft1000/
-obj-$(CONFIG_SND_INTEL_SST)		+= intel_sst/
-obj-$(CONFIG_SPEAKUP)	+= speakup/
+obj-$(CONFIG_SND_INTEL_SST)	+= intel_sst/
+obj-$(CONFIG_SPEAKUP)		+= speakup/
 obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217)	+= cptm1217/
 obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)	+= ste_rmi4/
+obj-$(CONFIG_DRM_PSB)		+= gma500/

What's with the formatting changes to this file?

thanks,

greg k-h

#2 lore raw
Quoted 6 lines
Quoted 2 lines

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

So that's all that is needed on the userspace side? Or is there a driver for X that also goes along with this patch that is available somewhere?

That's all that is needed.

There is an open source 2D X server but it relies upon the ttm working an ancient libdrm and some chunks of the PVR driver blob. The actual 2D command issue code is quite simple fortunately so the challenge is the ttm/bo stuff.

Quoted 3 lines

Can I also get a TODO file for this directory that lists what needs to be done to move it out of the staging tree, as well as an email to contact for patches and questions?

Ah I forgot to stg add that ;) it does exist.. Will send an updated version.

Quoted 15 lines
Quoted 15 lines
drivers/staging/Makefile +2 -3
@@ -62,12 +62,13 @@ obj-$(CONFIG_SOLO6X10)		+= solo6x10/
 obj-$(CONFIG_TIDSPBRIDGE)	+= tidspbridge/
 obj-$(CONFIG_ACPI_QUICKSTART)	+= quickstart/
 obj-$(CONFIG_WESTBRIDGE_ASTORIA)	+= westbridge/astoria/
-obj-$(CONFIG_SBE_2T3E3)	+= sbe-2t3e3/
+obj-$(CONFIG_SBE_2T3E3)		+= sbe-2t3e3/
 obj-$(CONFIG_ATH6K_LEGACY)	+= ath6kl/
 obj-$(CONFIG_USB_ENESTORAGE)	+= keucr/
-obj-$(CONFIG_BCM_WIMAX)	+= bcm/
+obj-$(CONFIG_BCM_WIMAX)		+= bcm/
 obj-$(CONFIG_FT1000)		+= ft1000/
-obj-$(CONFIG_SND_INTEL_SST)		+= intel_sst/
Quoted 8 lines

drivers/staging/Makefile obj-$(CONFIG_SOLO6X10) += solo6x10/ · line 74

Quoted 6 lines
drivers/staging/Makefile +3 -1
-obj-$(CONFIG_SPEAKUP)	+= speakup/
+obj-$(CONFIG_SND_INTEL_SST)	+= intel_sst/
+obj-$(CONFIG_SPEAKUP)		+= speakup/
 obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217)	+= cptm1217/
 obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)	+= ste_rmi4/
+obj-$(CONFIG_DRM_PSB)		+= gma500/

What's with the formatting changes to this file?

It used to be all nicely lined up and was degrading so as I was touching the end of it I thought I'd stop the rot.

#3 lore raw
In reply to Alan Cox
Quoted 10 lines · Alan Cox

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

There's a pretty significant amount of code duplication between the modesetting part of this and i915. In an idea world they'd be abstracted enough to avoid that, but I suspect that the risk of breaking i915 (which is something people actually care about) in favour of making the gma500 code (which is something people care about in a very different way) probably doesn't make it worth it right now.

Quoted 2 lines

I'm not a DRM expert so if there is anyone with a GMA500 who actually knows something about DRI internals then help would be most welcome.

I managed to palm mine off on a 9-year old, but we'll see if we can find something.

TTM is outside my comfort level, so we'll need to wait for some feedback from others on that. You may also want to Cc: dri-devel to get more eyes on it.

drivers/staging/gma500/psb_bl.c line 2

Quoted 3 lines
drivers/staging/gma500/psb_bl.c new file +2 -0
@@ -0,0 +1,167 @@
+/*
+ *  psb backlight using HAL

We're not using HAL so much these days.

drivers/staging/gma500/psb_bl.c line 76

Quoted 2 lines
drivers/staging/gma500/psb_bl.c new file +2 -0
+	/* return locally cached var instead of HW read (due to DPST etc.) */
+	return psb_brightness;

Ugh. We're really supposed to be doing readback from the hardware here, in case the firmware's changed something behind our back.

drivers/staging/gma500/psb_bl.c line 107

Quoted 1 line
drivers/staging/gma500/psb_bl.c new file +1 -0
+	value = (CoreClock * MHz) / BLC_PWM_FREQ_CALC_CONSTANT;

This hardware is spectacular.

Review line 7

Quoted 2 lines
(quoted diff) +2 -0
+struct mrst_panel_descriptor_v1{
+	uint32_t Panel_Port_Control; /* 1 dword, Register 0x61180 if LVDS */

Caps *and* underscores? Checkpatch.pl needs a -Wtaste switch.

drivers/staging/gma500/psb_drm.h line 397

Quoted 3 lines
drivers/staging/gma500/psb_drm.h new file +3 -0
+	uint16_t Panel_MIPI_Display_Descriptor;
+			/*16 bits, Defined as follows: */
+			/* if MIPI, 0x0000 if LVDS */

"Defined as follows if MIPI, 0x000 if LVDS"?

drivers/staging/gma500/psb_drm.h line 461

Quoted 1 line
drivers/staging/gma500/psb_drm.h new file +1 -0
+struct gct_ioctl_arg{

This never seems to be used. I'd be kind of terrified if it ever needed to be. In fact, are any of these vbt structures used at the moment?

drivers/staging/gma500/psb_drv.c line 42

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+int drm_psb_force_pipeb;

Unused.

drivers/staging/gma500/psb_drv.c line 43

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+int drm_idle_check_interval = 5;

Unused.

drivers/staging/gma500/psb_drv.c line 44

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+int gfxrtdelay = 2 * 1000;

Unused.

drivers/staging/gma500/psb_drv.c line 52

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+MODULE_PARM_DESC(force_pipeb, "Forces PIPEB to become primary fb");

Unused.

drivers/staging/gma500/psb_drv.c line 53

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+MODULE_PARM_DESC(ta_mem_size, "TA memory size in kiB");

Seems unused?

drivers/staging/gma500/psb_drv.c line 54

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+MODULE_PARM_DESC(ospm, "switch for ospm support");

What does OSPM translate as these days?

drivers/staging/gma500/psb_drv.c line 55

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+MODULE_PARM_DESC(rtpm, "Specifies Runtime PM delay for GFX");

Seems unused?

drivers/staging/gma500/psb_drv.c line 56

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+MODULE_PARM_DESC(hdmi_edid, "EDID info for HDMI monitor");

Thankfully unused.

drivers/staging/gma500/psb_drv.c line 66

Quoted 3 lines
drivers/staging/gma500/psb_drv.c new file +3 -0
+static struct pci_device_id pciidlist[] = {
+	{ 0x8086, 0x8108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PSB_8108 },
+	{ 0x8086, 0x8109, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PSB_8109 },

What hardware does this translate to at the moment? There's various bits that suggest Moorestown support, but I'm not clear whether it's included here or whether it's just the Poulsbo parts.

drivers/staging/gma500/psb_drv.c line 395

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+#if 1 /* FIXME remove it after PO */

P0?

drivers/staging/gma500/psb_drv.c line 444

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+		DRM_ERROR("Gatt must be 256M aligned. This is a bug.\n");

FW_BUG?

drivers/staging/gma500/psb_drv.c line 611

Quoted 1 line
drivers/staging/gma500/psb_drv.c new file +1 -0
+	DRM_INFO("Run drivers on Poulsbo platform!\n");

?

drivers/staging/gma500/psb_drv.c line 774

Quoted 7 lines
drivers/staging/gma500/psb_drv.c new file +7 -0
+	/**
+	 *  Init lid switch timer.
+	 *  NOTE: must do this after psb_intel_opregion_init
+	 *  and psb_backlight_init
+	 */
+	if (dev_priv->lid_state)
+		psb_lid_timer_init(dev_priv);

Gak. Shouldn't there be an SCI on state change on opregion systems?

drivers/staging/gma500/psb_drv.h line 56

Quoted 5 lines
drivers/staging/gma500/psb_drv.h new file +5 -0
+#define DRIVER_NAME "pvrsrvkm"
+#define DRIVER_DESC "drm driver for the Intel GMA500"
+#define DRIVER_AUTHOR "Intel Corporation"
+#define OSPM_PROC_ENTRY "ospm"
+#define RTPM_PROC_ENTRY "rtpm"

Debugfs?

Review line 38

Quoted 1 line
(quoted diff) +1 -0
+++ b/drivers/staging/gma500/psb_gfx.mod.c

I don't think you need this one :)

drivers/staging/gma500/psb_intel_bios.c line 276

Quoted 1 line
drivers/staging/gma500/psb_intel_bios.c new file +1 -0
+void psb_intel_destory_bios(struct drm_device *dev)

Oh if only...

drivers/staging/gma500/psb_intel_bios.h line 312

Quoted 4 lines
drivers/staging/gma500/psb_intel_bios.h new file +4 -0
+/*
+ * Driver<->VBIOS interaction occurs through scratch bits in
+ * GR18 & SWF*.
+ */

Do you actually support this? I'm pretty sure it's all ignored in i915, for better or worse.

Quoted 22 lines
drivers/staging/gma500/psb_intel_reg.h new file +22 -0
+#define BIT0  0x00000001
+#define BIT1  0x00000002
+#define BIT2  0x00000004
+#define BIT3  0x00000008
+#define BIT4  0x00000010
+#define BIT5  0x00000020
+#define BIT6  0x00000040
+#define BIT7  0x00000080
+#define BIT8  0x00000100
+#define BIT9  0x00000200
+#define BIT10 0x00000400
+#define BIT11 0x00000800
+#define BIT12 0x00001000
+#define BIT13 0x00002000
+#define BIT14 0x00004000
+#define BIT15 0x00008000
+#define BIT16 0x00010000
+#define BIT17 0x00020000
+#define BIT18 0x00040000
+#define BIT19 0x00080000
+#define BIT20 0x00100000
+#define BIT21 0x00200000

drivers/staging/gma500/psb_intel_reg.h line 793

Quoted 10 lines
drivers/staging/gma500/psb_intel_reg.h new file +10 -0
+#define BIT22 0x00400000
+#define BIT23 0x00800000
+#define BIT24 0x01000000
+#define BIT25 0x02000000
+#define BIT26 0x04000000
+#define BIT27 0x08000000
+#define BIT28 0x10000000
+#define BIT29 0x20000000
+#define BIT30 0x40000000
+#define BIT31 0x80000000

You have *got* to be kidding.

drivers/staging/gma500/psb_intel_reg.h line 944

Quoted 4 lines
drivers/staging/gma500/psb_intel_reg.h new file +4 -0
+/* ************************************************************************* *\
+The display module performs a software reset.
+Registers are written with their SW Reset default values.
+\* ************************************************************************* */

I'd be kind of happier if we kept to one style of boxing per header...

drivers/staging/gma500/psb_intel_opregion.c

Quoted 1 line
drivers/staging/gma500/psb_intel_opregion.c +0 -0

I know I said that I wasn't convinced there was a benefit in trying to use the existing 915 code, but our opregion implementation is sufficiently best-effort right now that I think this should really be merged with the existing one and that split out as a separate module. We completely ignore opregion-based lid handling now, which may contribute to the number of lid state bugs we have on intel.

Quoted 1 line

+++ b/drivers/staging/gma500/psb_intel_sdvo.c

Does PSB really support SDVO? I thought by that period the only thing it'd be used for was plug-in SDVO cards, which doesn't seem so likely with PSB.

drivers/staging/gma500/psb_intel_opregion.c

Quoted 4 lines
drivers/staging/gma500/psb_intel_opregion.c +4 -0
+/*
+ * It is used to enable VBLANK interrupt
+ */
+int psb_enable_vblank(struct drm_device *dev, int pipe)

I was confused until I read the comment. Wait.

drivers/staging/gma500/psb_powermgmt.c

Quoted 1 line
drivers/staging/gma500/psb_powermgmt.c +0 -0

I have to say that the code in here scares me, but we'll see how it works...

Quoted 1 line

+#ifdef CONFIG_MDFD_GL3

Ugh. No way to determine this at runtime? Having to build this per-device sounds like a recipe for sadness.

drivers/staging/gma500/psb_pvr_glue.c

Quoted 1 line
drivers/staging/gma500/psb_pvr_glue.c +0 -0

Do we need this at all without the PVR code?

drivers/staging/gma500/psb_pvr_glue.c

Quoted 13 lines
drivers/staging/gma500/psb_pvr_glue.c +13 -0
+void psb_lid_timer_init(struct drm_psb_private *dev_priv)
+{
+	struct timer_list *lid_timer = &dev_priv->lid_timer;
+	unsigned long irq_flags;
+
+	spin_lock_init(&dev_priv->lid_lock);
+	spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
+
+	init_timer(lid_timer);
+
+	lid_timer->data = (unsigned long)dev_priv;
+	lid_timer->function = psb_lid_timer_func;
+	lid_timer->expires = jiffies + PSB_LID_DELAY;

So we're waking up 10 times a second just to check the lid state?

drivers/staging/gma500/psb_ttm_fence.c

Quoted 1 line
drivers/staging/gma500/psb_ttm_fence.c +0 -0

This really looks like it's intended to be core TTM functionality, so it should probably go past dri-devel.

This is definitely the best gma500 driver we've seen yet, but it seems like there's two directions it can go. If the intention for now is to provide a kernel-quality unaccelerated 2D driver then there's a *lot* more code that can just be ripped out. If we want the acceleration to work then there's an argument that we should be abstracting that into a more generic SGX layer that other drivers can make use of. Does omapfb have any acceleration? If so, is there anything we can build on there?

Other than that, I think there's a few bogosities here. The only thing I'd really ask about in terms of whether it's ready to go in staging is whether all of those ioctls need to be exposed at the moment. Beyond that I'd like to see the opregion code unified, but for the most part we're talking about the kind of cleanups that staging is meant for.

Signature · 1 line
Matthew Garrett | [email protected]
#4 lore raw
Quoted 6 lines

There's a pretty significant amount of code duplication between the modesetting part of this and i915. In an idea world they'd be abstracted enough to avoid that, but I suspect that the risk of breaking i915 (which is something people actually care about) in favour of making the gma500 code (which is something people care about in a very different way) probably doesn't make it worth it right now.

I was specifically instructed by Keith Packard not to do so.

Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+struct mrst_panel_descriptor_v1{
+	uint32_t Panel_Port_Control; /* 1 dword, Register 0x61180 if LVDS */

Caps *and* underscores? Checkpatch.pl needs a -Wtaste switch.

There is plenty of that - hence staging. I think what we actually need is an emacs and vim "C with taste" mode which errors hungarian notation and the like ;)

[April 1st project for someone maybe or perhaps a masters project in runtime enforcement/correction to CodingStyle : "I'm sorry Dave I can't let you save that, it's not passing Checkpatch.pl"]

Quoted 5 lines

drivers/staging/gma500/psb_drm.h line 397

Quoted 3 lines
drivers/staging/gma500/psb_drm.h new file +3 -0
+	uint16_t Panel_MIPI_Display_Descriptor;
+			/*16 bits, Defined as follows: */
+			/* if MIPI, 0x0000 if LVDS */

"Defined as follows if MIPI, 0x000 if LVDS"?

I don't believe MIPI is supported on PSB anyway. There is a fair bit more that can come out.

Quoted 4 lines
Quoted 1 line

+struct gct_ioctl_arg{

This never seems to be used. I'd be kind of terrified if it ever needed to be. In fact, are any of these vbt structures used at the moment?

Probably not - staging, this is the kind of stuff to get cleaned up with many eyes and more expertise

Quoted 3 lines
Quoted 1 line

+MODULE_PARM_DESC(ospm, "switch for ospm support");

What does OSPM translate as these days?

Basically the management hooks for power. For PSB they don't matter, in fact the SCH errata document implies they shouldn't get used on PSB. For MRST we need the hook points but to rewrite the functionality underneath properly to talk to an alternative power management system - like the one the kernel provides us with.

Quoted 9 lines

drivers/staging/gma500/psb_drv.c line 774

Quoted 7 lines
drivers/staging/gma500/psb_drv.c new file +7 -0
+	/**
+	 *  Init lid switch timer.
+	 *  NOTE: must do this after psb_intel_opregion_init
+	 *  and psb_backlight_init
+	 */
+	if (dev_priv->lid_state)
+		psb_lid_timer_init(dev_priv);

Gak. Shouldn't there be an SCI on state change on opregion systems?

Beats me. I try not to touch anything involving or related to ACPI

Quoted 1 line

You have *got* to be kidding.

You didnt see it before I started !

Quoted 2 lines

I know I said that I wasn't convinced there was a benefit in trying to use the existing 915 code, but our opregion implementation is

I'm not fussed on this, but whoever wants to make that call can have a kitten throwing contest with KeithP.

Quoted 5 lines
Quoted 1 line

+++ b/drivers/staging/gma500/psb_intel_sdvo.c

Does PSB really support SDVO? I thought by that period the only thing it'd be used for was plug-in SDVO cards, which doesn't seem so likely with PSB.

I don't know - there is lots to prune. There are PSB using deviced with dual outputs and I've no idea if internally its done via SDVO (eg some of the Dell Mini 10's apparently have an HDMI port hung off something)

Quoted 11 lines

drivers/staging/gma500/psb_irq.c line 525

Quoted 4 lines
drivers/staging/gma500/psb_irq.c new file +4 -0
+/*
+ * It is used to enable VBLANK interrupt
+ */
+int psb_enable_vblank(struct drm_device *dev, int pipe)

I was confused until I read the comment. Wait.

drivers/staging/gma500/psb_powermgmt.c

Quoted 1 line
drivers/staging/gma500/psb_powermgmt.c +0 -0

I have to say that the code in here scares me, but we'll see how it works...

The power code needs what is technically know as a rewrite. But the hooks are in the right place and to add Moorestown support we need the hooks there.

Quoted 4 lines
Quoted 1 line

+#ifdef CONFIG_MDFD_GL3

Ugh. No way to determine this at runtime? Having to build this per-device sounds like a recipe for sadness.

It's actually not part of PSB or MRST so that can go.

Quoted 5 lines

drivers/staging/gma500/psb_powermgmt.c

Quoted 3 lines
drivers/staging/gma500/psb_powermgmt.c +3 -0
+	lid_timer->data = (unsigned long)dev_priv;
+	lid_timer->function = psb_lid_timer_func;
+	lid_timer->expires = jiffies + PSB_LID_DELAY;

So we're waking up 10 times a second just to check the lid state?

Don't we totally rock

Quoted 6 lines

like there's two directions it can go. If the intention for now is to provide a kernel-quality unaccelerated 2D driver then there's a *lot* more code that can just be ripped out. If we want the acceleration to work then there's an argument that we should be abstracting that into a more generic SGX layer that other drivers can make use of. Does omapfb have any acceleration? If so, is there anything we can build on there?

I doubt there is much you can share. The register layout depends on the chip version (read the imagination kernel driver "GPL" splat from Imagination and weep), the mode setting is device dependant and I don't know about the 2D but I believe it's also not quite the same.

I do want to get 2D acceleration working, we have all the open bits for that including compositing.

Opregion does look like there should be one only.

Quoted 3 lines

Other than that, I think there's a few bogosities here. The only thing I'd really ask about in terms of whether it's ready to go in staging is whether all of those ioctls need to be exposed at the moment.

Staging = no API guarantee, so I'm fairly happy about it - and having it for testing is handy.

Alan

#5 lore raw
In reply to Matthew Garrett
Quoted 8 lines · Matthew Garrett
Quoted 7 lines · Alan Cox

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

Quoted 9 lines
Quoted 5 lines

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

+++ b/drivers/staging/gma500/psb_intel_sdvo.c

Does PSB really support SDVO? I thought by that period the only thing it'd be used for was plug-in SDVO cards, which doesn't seem so likely with PSB.

The Fit-PC2 needs SDVO for its DVI/HDMI output. The SDVO chip is likely put directly on the PCB. I tried to write my own driver for the gma500 (called it i500) which had all the SDVO stuff in place, but I never sorted out the TTM stuff so it's been gathering dust for quite some time now.

Quoted 11 lines

drivers/staging/gma500/psb_ttm_fence.c

Quoted 1 line
drivers/staging/gma500/psb_ttm_fence.c +0 -0

This really looks like it's intended to be core TTM functionality, so it should probably go past dri-devel.

This is definitely the best gma500 driver we've seen yet, but it seems like there's two directions it can go. If the intention for now is to provide a kernel-quality unaccelerated 2D driver then there's a *lot* more code that can just be ripped out. If we want the acceleration to work then there's an argument that we should be abstracting that into a more generic SGX layer that other drivers can make use of. Does omapfb have any acceleration? If so, is there anything we can build on there?

From what I can see, omapfb doesn't have any acceleration, and yes, it would be very nice to have a generic SGX layer.

Cheers
Patrik Jakobsson

#6 lore raw
In reply to Alan Cox
Quoted 11 lines · Alan Cox

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

Quoted 7 lines

There is no support for the parts without open source userspace (video accelerators, 3D) as per kernel policy.

I'm not a DRM expert so if there is anyone with a GMA500 who actually knows something about DRI internals then help would be most welcome.

Great to see progress here!

Before I start looking at the code, one high-level question: How much of the code in the gma500 driver would be shared with SOCs from other people (ARM based, typically) that use the PowerVR SGX core?

IOW, is this driver only for parts that Intel (or whoever) has put around the licensed 3D core, or is it actually the same code that the others would use for a non-3D SGX driver?

Arnd

#7 lore raw
Quoted 3 lines

Before I start looking at the code, one high-level question: How much of the code in the gma500 driver would be shared with SOCs from other people (ARM based, typically) that use the PowerVR SGX core?

My understanding is none.

Quoted 3 lines

IOW, is this driver only for parts that Intel (or whoever) has put around the licensed 3D core, or is it actually the same code that the others would use for a non-3D SGX driver?

The mode setting is all Intel - hence the similarity to i9xx

Alan

#8 lore raw
In reply to Alan Cox
Quoted 11 lines · Alan Cox

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

Quoted 6 lines

There is no support for the parts without open source userspace (video accelerators, 3D) as per kernel policy.

I'm not a DRM expert so if there is anyone with a GMA500 who actually knows something about DRI internals then help would be most welcome.

Okay I'm okay with this going into staging but we should work out a plan for it going forward.

I don't have any poulsbo hw but if some were to appear I could probably expend effort on this.

So where do we want to go my opinion is

a) remove all userspace interfaces and simplify ttm memory management usage.
b) add support to hook this up to the dumb ioctl so we can do trivial generic front buffer allocation, so then a libkms + dumb kms modesetting driver can work on it.
c) figure out how to add interface for acceleration users. Whether TTM fence interfaces are required etc.

We could probably just add a GEM style buffer allocation interface but we'd probably need to do a lot of RE first to figure out what best suits the hardware, I'm pretty sure I've haven't heard any glowing praise that the current interface suits the hw or is maintainable.

Dave.

#9 lore raw
Quoted 15 lines · Dave Airlie
Quoted 14 lines · Alan Cox

This is an initial staging driver for the GMA500. It's been stripped out of the PVR drivers and crunched together from various bits of code and different kernels.

Currently it's unaccelerated but still pretty snappy even compositing with the frame buffer X server.

Lots of work is needed to rework the ttm and bo interfaces from being ripped out and then 2D acceleration wants putting back for framebuffer and somehow eventually via DRM.

There is no support for the parts without open source userspace (video accelerators, 3D) as per kernel policy.

Quoted 7 lines
Quoted 3 lines

I'm not a DRM expert so if there is anyone with a GMA500 who actually knows something about DRI internals then help would be most welcome.

Okay I'm okay with this going into staging but we should work out a plan for it going forward.

Good as I just added it to the staging-next tree a few hours ago :)

Quoted 11 lines

I don't have any poulsbo hw but if some were to appear I could probably expend effort on this.

So where do we want to go my opinion is

a) remove all userspace interfaces and simplify ttm memory management usage.
b) add support to hook this up to the dumb ioctl so we can do trivial generic front buffer allocation, so then a libkms + dumb kms modesetting driver can work on it.
c) figure out how to add interface for acceleration users. Whether TTM fence interfaces are required etc.

That all sounds reasonable to me. Patches now gladly accepted.

thanks,

greg k-h

#10 lore raw
In reply to Dave Airlie
Quoted 3 lines

So where do we want to go my opinion is

a) remove all userspace interfaces and simplify ttm memory management usage.

Some of them appear to be valid/sensible ones for querying mode data and config bits. I'm slowly pruning out the rest

Quoted 3 lines

b) add support to hook this up to the dumb ioctl so we can do trivial generic front buffer allocation, so then a libkms + dumb kms modesetting driver can work on it.

What sort of dumb ioctl do you have in mind ?

Quoted 2 lines

c) figure out how to add interface for acceleration users. Whether TTM fence interfaces are required etc.

The fencing seems to be solely for the various capture/acceleration bits for video as far as I can tell.

It seems we need two things - issue a 2D command and stuff for transferring objects, although it's not clear that the latter is needed.

The old X 2D code is at:
http://git.moblin.org/cgit.cgi/deprecated/xf86-video-psb/

Quoted 4 lines

We could probably just add a GEM style buffer allocation interface but we'd probably need to do a lot of RE first to figure out what best suits the hardware, I'm pretty sure I've haven't heard any glowing praise that the current interface suits the hw or is maintainable.

Nor me

I'll push the 2D bits to the tree but disabled (right now they go pop and I've not pinned down what register or other incantation I've missed somewhere) so there is a better view of what is needed.

Alan

#11 lore raw
Quoted 4 lines · Alan Cox
Quoted 3 lines

So where do we want to go my opinion is

a) remove all userspace interfaces and simplify ttm memory management usage.

Quoted 8 lines

Some of them appear to be valid/sensible ones for querying mode data and config bits. I'm slowly pruning out the rest

Quoted 3 lines

b) add support to hook this up to the dumb ioctl so we can do trivial generic front buffer allocation, so then a libkms + dumb kms modesetting driver can work on it.

What sort of dumb ioctl do you have in mind ?

Its already in my drm-next tree,
http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=commit;h=ff72145badb834e8051719ea66e024784d000cb4

the idea being we can allocate and map a buffer that we can use for doing dumb operations in an fbdev like manner,
the handles can be passed to the normal generic drm KMS ioctls. It avoids simple userspaces having to know about the per-driver GEM accel interfaces. Of course to add acceleration you need to get off this interface but it at least means getting something simple up and running with full KMS output control.

Quoted 4 lines
Quoted 3 lines

c) figure out how to add interface for acceleration users. Whether TTM fence interfaces are required etc.

Quoted 8 lines

The fencing seems to be solely for the various capture/acceleration bits for video as far as I can tell.

It seems we need two things - issue a 2D command and stuff for transferring objects, although it's not clear that the latter is needed.

The old X 2D code is at:
http://git.moblin.org/cgit.cgi/deprecated/xf86-video-psb/

Okay I'll try and have a look at that and see whats its doing.

Dave.