For about a year and a half, the Qualcomm Linux team has been working to support
the OpenGL ES 3D core in the Snapdragon processor. The hardware made its debut
in the Nexus One and has subsequently been used in a few other commercial
products since then. To support the 3D GPU we wrote a kernel based driver to
manage all the usual graphics concerns - interrupts, command streams, context
switching, etc, etc. You can see the latest and greatest incarnation
of our driver here:
https://www.…
[View More]codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=tree;f=driver…
I'm writing this email because we think it is high time that we get off the
bench, into the game and push support for the Qualcomm graphics cores to the
mainline kernel. We are looking for advice and comment from the community on
the approach we have taken and what steps we might need to take, if any, to
modify the driver so it can be accepted. I'm going to offer up a quick
description of the hardware and describe our current approach as well as our
current development plan for the summer. Our goal is to start pushing this
code upstream as quickly as possible, so comments and flames would be greatly
appreciated.
=====
The hardware layout is reasonably straight forward. The GPU is, as expected,
a platform device located on the same die as the processor. The registers are
mapped into the physical address space of the processor. There device also
shares memory with the main processor; there is no dedicated memory on board
for the GPU. The GPU has a built in MMU for mapping paged memory.
Some processor variants also have a separate 2D core attached. The 2D core is
also a platform device with shared memory and a MM. While the general interface
is similar to the 3D core, the 2D GPU has its own separate pipeline and
interrupt.
The core of the driver is a home-grown ioctl() API through a character device
we call /dev/kgsl. Like other GPU drivers, all the heavy lifting is done by
the userspace drivers so the core set of ioctls are mainly used to access the
hardware or to manage contexts:
IOCTL_KGSL_DEVICE_GETPROPERTY
IOCTL_KGSL_DEVICE_REGREAD
IOCTL_KGSL_DEVICE_REGWRITE
IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS
IOCTL_KGSL_DEVICE_WAITTIMESTAMP
IOCTL_KGSL_CMDSTREAM_READTIMESTAMP
IOCTL_KGSL_DRAWCTXT_CREATE
IOCTL_KGSL_DRAWCTXT_DESTROY
In the early days of the driver, any memory used for the GPU (command buffers,
color buffers, etc) were allocated by the user space driver through PMEM (a
simple contiguous memory allocator written for Android; see
drivers/misc/pmem.c). PMEM is not ideal because the contiguous memory it uses
needs to be carved out of bootmem at init time and is lost to the general
system pool, so the driver was switched to use paged memory allocated via
vmalloc() and mapped into the GPU MMU. As a result, a handful of additional
ioctls were put into the driver to support allocating and managing the memory.
When we started our X11 effort last year, we needed a DRM driver to support
DRI2. We added a DRM skeleton to the existing GPU driver (this was the driving
force behind the platform DRM patches I've sent out periodically). The DRM
driver allocates its own memory for buffers to support GEM, and the buffers are
mapped into the GPU MMU prior to rendering. It is important to note that the
DRM driver only provides GEM and basic DRM services - the userspace graphics
libraries still run rendering through the /dev/kgsl interface.
Then, when support came along for the 2D core, it turned out that most of the
support code was identical to that for the 3D GPU, with only a few differences
in how the command streams and interrupts were processed. The 2D and 3D code
were merged together to form the driver that I linked above. The ioctl calls
remained the same, and a "device" member was added to each structure to
determine which core the call was destined for. Each device has its own MMU,
but each MMU shares the same pagetables.
It has been argued that having the 2D and the 3D together is silly since they
are separate platform devices and they should be treated as such - the
proposal is to have multiple device nodes, one for each device. Each device
will have its iomapped registers, MMU pagetables, etc; while sharing generic
support code in the driver:
/dev/kgsl/0
/dev/kgsl/1
etc..
I think that if we did this design we would also need to have an additional
device to allocate memory buffers which will make it easier for us to share
memory between cores (X11 in particular does a lot of simultaneous 2D and 3D).
I also think that the memory allocator should be transitioned to a standard
design (probably TTM). Of course for X11 the DRM/GEM driver would still be
used with GEM turning into a wrapper for the shared memory allocator.
Thanks for reading,
Jordan
PS: About the name: our userspace drivers uses a HAL called GSL (for graphics
support layer). Elements of that HAL is what you see today in the kernel
driver, so we called it KGSL (Kernel GSL). We used to have the driver in
drivers/char/msm_kgsl/ but we were convinced to move it to drivers/gpu/msm,
which is already a great improvement in naming and in location. I presume
that one of the conditions of upstreaming would be to rename everything to
something a little bit more descriptive and a little bit less cryptic.
--
Jordan Crouse
Qualcomm Innovation Center
Qualcomm Innovation Center is a member of Code Aurora Forum
[View Less]
https://bugs.freedesktop.org/show_bug.cgi?id=27563
Jesse Barnes <jbarnes(a)virtuousgeek.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|jbarnes(a)virtuousgeek.org |dri-devel(a)lists.freedesktop
| |.org
--- Comment #4 from Jesse Barnes <jbarnes(a)virtuousgeek.org> 2010-07-01 14:08:30 PDT ---
Yeah you're currently …
[View More]stuck with reading source; the git logs may have some
useful info on converting things...
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
[View Less]
Hello,
If someone wants to take a look at this bug I'd be glad:
"KMS:RV635:Radeon 3650HD graphics driver broken on a laptop when connected to a docking station and external display":
https://bugzilla.redhat.com/show_bug.cgi?id=593429
I'd like to help debugging it.. let me know what to try, if more information is needed..
I'm running Fedora 13.
-- Pasi
Okay same tree as yesterday, with the fix for the regression Markus
reported (good fast work by Alex), fix for resume on one of my laptops,
Rafael's resume fix, and a dynpm fix that I missed.
Otherwise:
one fb layer fix in a flag I introduced,
the rest are drm fixes:
radeon fixes: the larger ones in the command stream checker for older
cards,
which was causing a lot of userspace apps to fail. Also some powerpc
server fixes.
along with some updates to the evergreen command stream checker …
[View More]introduced
in -rc1.
agp: fix issue with warning on memory allocation + fallback to vmalloc.
ttm: fix regression introduced in -rc1 in memory allocation paths.
The following changes since commit 7e27d6e778cd87b6f2415515d7127eba53fe5d02:
Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)
are available in the git repository at:
ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes
Adam Jackson (1):
drm/fb: Fix video= mode computation
Alex Deucher (10):
drm/radeon/kms: fix bandwidth calculation when sideport is present
drm/radeon/kms: fix DP after DPMS cycle
drm/radeon/kms: fix typo in evergreen_gpu_init
drm/radeon/kms: disable frac fb dividers for rs6xx
drm/radeon/kms: avoid oops on mac r4xx cards
drm/radeon/kms: fix typos in evergreen command checker
drm/radeon/kms: add some missing regs to evergreen gpu init
drm/radeon/kms/igp: fix possible divide by 0 in bandwidth code (v2)
drm/radeon/kms/pm: fix power state indexing on igp chips in dynpm mode
drm/radeon/kms: remove rv100 bios connector quirk
Cedric Godin (1):
drm/radeon/kms: fix dpms state on resume
Dave Airlie (8):
drm/radeon: fix dual-head on rv250
radeon/kms: fix powerpc/rn50 untiled behaviour.
agp: drop vmalloc flag.
agp: add no warn since we have a fallback to vmalloc paths
drm/radeon: add fake RN50 table for powerpc
drm/radeon/kms: don't read attempt to read bios from VRAM on unposted GPU.
fb: fix colliding defines for fb flags.
drm/radeon: add quirk to make HP nx6125 laptop resume.
Jerome Glisse (2):
drm/ttm: non pooled page allocation should have GFP_USER set
drm/radeon/kms: Force HDP_NONSURF to maximum size
Matt Turner (1):
drm/radeon/kms: return ret in cursor_set failure path
Rafael J. Wysocki (1):
DRM / radeon / KMS: Fix hibernation regression related to radeon PM (was: Re: [Regression, post-2.6.34] Hibernation broken on machines with radeon/KMS and r300)
Roland Scheidegger (3):
drm/radeon/kms: CS checker texture fixes for r1xx/r2xx/r3xx
drm/radeon/r200: handle more hw tex coord types
drm/radeon/r100/r200: fix calculation of compressed cube maps
drivers/char/agp/generic.c | 6 +-
drivers/gpu/drm/drm_fb_helper.c | 19 ++++--
drivers/gpu/drm/radeon/atombios_crtc.c | 2 +-
drivers/gpu/drm/radeon/evergreen.c | 35 ++++++++--
drivers/gpu/drm/radeon/evergreen_cs.c | 4 +-
drivers/gpu/drm/radeon/evergreend.h | 3 +
drivers/gpu/drm/radeon/r100.c | 81 +++++++++++++---------
drivers/gpu/drm/radeon/r200.c | 5 ++
drivers/gpu/drm/radeon/r300.c | 5 ++
drivers/gpu/drm/radeon/r600.c | 17 ++++--
drivers/gpu/drm/radeon/radeon.h | 4 +-
drivers/gpu/drm/radeon/radeon_asic.c | 7 ++
drivers/gpu/drm/radeon/radeon_bios.c | 4 +
drivers/gpu/drm/radeon/radeon_combios.c | 49 +++++++++++---
drivers/gpu/drm/radeon/radeon_cursor.c | 2 +-
drivers/gpu/drm/radeon/radeon_device.c | 7 ++
drivers/gpu/drm/radeon/radeon_encoders.c | 4 +-
drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 22 +++----
drivers/gpu/drm/radeon/radeon_mode.h | 1 +
drivers/gpu/drm/radeon/radeon_pm.c | 41 ++++++++++--
drivers/gpu/drm/radeon/reg_srcs/evergreen | 10 ++--
drivers/gpu/drm/radeon/rs690.c | 41 ++++++------
drivers/gpu/drm/radeon/rv770.c | 2 +-
drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
include/linux/agp_backend.h | 1 -
include/linux/fb.h | 4 +-
26 files changed, 257 insertions(+), 121 deletions(-)
[View Less]