profile/ivi/kernel-x86-ivi.git
13 years agodrm/radeon: Move r100_*_*reg out of line
Andi Kleen [Thu, 13 Oct 2011 23:08:42 +0000 (16:08 -0700)]
drm/radeon: Move r100_*_*reg out of line

This shrinks the sizes of a lot of functions in the radeon driver
dramatically.

With a non force inline + -Os kernel this is default anyways.

Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: Move more code out of line
Andi Kleen [Thu, 13 Oct 2011 23:08:47 +0000 (16:08 -0700)]
drm/radeon: Move more code out of line

With this patch I'm only about 50k larger with DRM debugging
enables (why is that enabled by default?!?), and slightly
smaller without.

[airlied: moved r100.c additions to radeon_ring.c]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: Remove more bogus inlines in the radeon driver.
Andi Kleen [Thu, 13 Oct 2011 23:08:46 +0000 (16:08 -0700)]
drm/radeon: Remove more bogus inlines in the radeon driver.

Remove bogus inlines in evergreen and r100.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: Remove now unused functions in radeon driver
Andi Kleen [Thu, 13 Oct 2011 23:08:44 +0000 (16:08 -0700)]
drm/radeon: Remove now unused functions in radeon driver

With the dropped inlines gccs starts warning about genuinely unused
functions. Remove r600_bpe_from_format, evergreen_cs_track_validate_cb,
evergreen-cs_packet_next_is_pkt3_nop which are all unused.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: drop inlines in r600_blit.c
Andi Kleen [Thu, 13 Oct 2011 23:08:43 +0000 (16:08 -0700)]
drm/radeon: drop inlines in r600_blit.c

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: Drop inlines from evergreen_cs.c / r600_cs.c
Andi Kleen [Thu, 13 Oct 2011 23:08:41 +0000 (16:08 -0700)]
drm/radeon: Drop inlines from evergreen_cs.c / r600_cs.c

Fixes

evergreen_cs_parse                          4080   23124  +19044

and others compared to a non force inline kernel.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Add vblank stubs
Jakob Bornecrantz [Mon, 17 Oct 2011 09:59:45 +0000 (11:59 +0200)]
vmwgfx: Add vblank stubs

This fixes kernel panics when running the vbltest from the drm repo. We
can't just skip initializing the vblank system since it sets up certain
state for us, see: "vmwgfx: Enable use of the vblank system."

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Whitespace & code style in display unit
Jakob Bornecrantz [Mon, 17 Oct 2011 09:59:44 +0000 (11:59 +0200)]
vmwgfx: Whitespace & code style in display unit

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Fix display system init & close functions
Jakob Bornecrantz [Mon, 17 Oct 2011 09:59:43 +0000 (11:59 +0200)]
vmwgfx: Fix display system init & close functions

Make sure we null the display private, make sure we catch and
handle vblank failing to init and don't call vblank_cleanup if
we haven't initialized the display system.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: allow pcie gen2 speed on Cayman
Ilija Hadzic [Tue, 20 Sep 2011 14:22:58 +0000 (10:22 -0400)]
drm/radeon: allow pcie gen2 speed on Cayman

Looks like the same pcie gen2 speed initialization for
Evergreen also works on Cayman and seems to come up fine,
so enable it if the module parameter says so

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: allow pcie gen2 speed on NI
Ilija Hadzic [Tue, 20 Sep 2011 14:22:57 +0000 (10:22 -0400)]
drm/radeon: allow pcie gen2 speed on NI

Enabling pcie gen2 speed was skipped for Northern Islands
AISCs, although it looks like it works just fine with the same
initialization sequence used for evergreen.

According to Alex D. gen2 init was skipped to prevent a crash
that has been caused by some other bug that has been
fixed in the meantime; so now it should be safe to enable it.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Take the driver out of staging
Thomas Hellstrom [Tue, 11 Oct 2011 08:42:51 +0000 (10:42 +0200)]
vmwgfx: Take the driver out of staging

Also improve a bit on the Kconfig help.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm: Add KMS debug printk's for encoder and crtc fixup failure
Adam Jackson [Mon, 10 Oct 2011 20:21:27 +0000 (16:21 -0400)]
drm: Add KMS debug printk's for encoder and crtc fixup failure

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into...
Dave Airlie [Mon, 10 Oct 2011 19:05:21 +0000 (20:05 +0100)]
Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into drm-core-next

* 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux:
  drm/i915: Dumb down the semaphore logic
  drm/i915: pass ELD to HDMI/DP audio driver
  drm: support routines for HDMI/DP ELD
  drm/i915: Enable dither whenever display bpc < frame buffer bpc
  drm/i915: Enable dither whenever display bpc < frame buffer bpc

13 years agovmwgfx: Wrap drm_read and drm_poll
Thomas Hellstrom [Mon, 10 Oct 2011 10:23:27 +0000 (12:23 +0200)]
vmwgfx: Wrap drm_read and drm_poll

Make sure the device is processing the fifo when these functions are
called in case they might sleep waiting for an event.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Add fence events
Thomas Hellstrom [Mon, 10 Oct 2011 10:23:26 +0000 (12:23 +0200)]
vmwgfx: Add fence events

Add a way to send DRM events down the gpu fifo by attaching them to
fence objects. This may be useful for Xserver swapbuffer throttling and
page-flip done notifications.

Bump version to 2.2 to signal the availability of the FENCE_EVENT ioctl.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Break out and comment vmw_execbuf_copy_fence_user
Thomas Hellstrom [Mon, 10 Oct 2011 10:23:25 +0000 (12:23 +0200)]
vmwgfx: Break out and comment vmw_execbuf_copy_fence_user

This function will be used also by the upcoming fence event code,
so break it out and add a comment about the functionality.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: set DMA mask properly on newer PCI asics
Alex Deucher [Wed, 5 Oct 2011 14:02:57 +0000 (10:02 -0400)]
drm/radeon/kms: set DMA mask properly on newer PCI asics

If a card wasn't PCIE, we always set the DMA mask to 32 bits.
This is only applies to the old rage128/r1xx gart block on
early radeon asics (~r1xx-r4xx).  Newer PCI and IGP cards
can handle 40 bits just fine.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Chen Jie <chenj@lemote.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoDRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
Michael Witten [Fri, 16 Sep 2011 20:45:30 +0000 (20:45 +0000)]
DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}

The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
specify the size of an array, each element of which looks
like this:

  struct radeon_debugfs {
          struct drm_info_list    *files;
          unsigned                num_files;
  };

Consequently, the number of debugfs files may be much greater
than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
code ignores:

  if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
          DRM_ERROR("Reached maximum number of debugfs files.\n");
          DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
          return -EINVAL;
  }

This commit fixes this make, and accordingly renames:

  RADEON_DEBUGFS_MAX_NUM_FILES

to:

  RADEON_DEBUGFS_MAX_COMPONENTS

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: handle !force case in connector detect more gracefully
Alex Deucher [Fri, 7 Oct 2011 18:23:48 +0000 (14:23 -0400)]
drm/radeon/kms: handle !force case in connector detect more gracefully

When force == false, we don't do load detection in the connector
detect functions.  Unforunately, we also return the previous
connector state so we never get disconnect events for DVI-I, DVI-A,
or VGA.  Save whether we detected the monitor via load detection
previously and use that to determine whether we return the previous
state or not.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41561

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: bail early in dvi_detect for digital only connectors
Alex Deucher [Fri, 7 Oct 2011 18:23:47 +0000 (14:23 -0400)]
drm/radeon/kms: bail early in dvi_detect for digital only connectors

DVI-D and HDMI-A are digital only, so there's no need to
attempt analog load detect.  Also, skip bail before the
!force check, or we fail to get a disconnect events.
The next patches in the series attempt to fix disconnect
events for connectors with analog support (DVI-I, HDMI-B,
DVI-A).

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41561

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: Fix I2C mask definitions
Jean Delvare [Thu, 6 Oct 2011 16:16:24 +0000 (18:16 +0200)]
drm/radeon/kms: Fix I2C mask definitions

Commit 9b9fe724 accidentally used RADEON_GPIO_EN_* where
RADEON_GPIO_MASK_* was intended. This caused improper initialization
of I2C buses, mostly visible when setting i2c_algo_bit.bit_test=1.
Using the right constants fixes the problem.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Jerome Glisse <j.glisse@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Don't use virtual coords when using screen objects
Jakob Bornecrantz [Fri, 7 Oct 2011 13:23:07 +0000 (15:23 +0200)]
vmwgfx: Don't use virtual coords when using screen objects

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Implement memory accounting for resources
Thomas Hellstrom [Fri, 7 Oct 2011 13:23:06 +0000 (15:23 +0200)]
vmwgfx: Implement memory accounting for resources

Contexts, surfaces and streams allocate persistent kernel memory as the
direct result of user-space requests. Make sure this memory is
accounted as graphics memory, to avoid DOS vulnerabilities.

Also take the TTM read lock around resource creation to block
switched-out dri clients from allocating resources.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoDRM: add DRM Driver for Samsung SoC EXYNOS4210.
Inki Dae [Tue, 4 Oct 2011 10:19:01 +0000 (19:19 +0900)]
DRM: add DRM Driver for Samsung SoC EXYNOS4210.

This patch is a DRM Driver for Samsung SoC Exynos4210 and now enables
only FIMD yet but we will add HDMI support also in the future.

this patch is based on git repository below:
git://people.freedesktop.org/~airlied/linux.git
branch name: drm-next
commit-id: 88ef4e3f4f616462b78a7838eb3ffc3818d30f67

you can refer to our working repository below:
http://git.infradead.org/users/kmpark/linux-2.6-samsung
branch name: samsung-drm

We tried to re-use lowlevel codes of the FIMD driver(s3c-fb.c
based on Linux framebuffer) but couldn't so because lowlevel codes
of s3c-fb.c are included internally and so FIMD module of this driver has
its own lowlevel codes.

We used GEM framework for buffer management and DMA APIs(dma_alloc_*)
for buffer allocation so we can allocate physically continuous memory
for DMA through it and also we could use CMA later if CMA is applied to
mainline.

Refer to this link for CMA(Continuous Memory Allocator):
http://lkml.org/lkml/2011/7/20/45

this driver supports only physically continuous memory(non-iommu).

Links to previous versions of the patchset:
v1: < https://lwn.net/Articles/454380/ >
v2: < http://www.spinics.net/lists/kernel/msg1224275.html >
v3: < http://www.spinics.net/lists/dri-devel/msg13755.html >
v4: < http://permalink.gmane.org/gmane.comp.video.dri.devel/60439 >
v5: < http://comments.gmane.org/gmane.comp.video.dri.devel/60802 >

Changelog v2:
DRM: add DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl command.

    this feature maps user address space to physical memory region
    once user application requests DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl.

DRM: code clean and add exception codes.

Changelog v3:
DRM: Support multiple irq.

    FIMD and HDMI have their own irq handler but DRM Framework can regiter
    only one irq handler this patch supports mutiple irq for Samsung SoC.

DRM: Consider modularization.

    each DRM, FIMD could be built as a module.

DRM: Have indenpendent crtc object.

    crtc isn't specific to SoC Platform so this patch gets a crtc
    to be used as common object.
    created crtc could be attached to any encoder object.

DRM: code clean and add exception codes.

Changelog v4:
DRM: remove is_defult from samsung_fb.

    is_default isn't used for default framebuffer.

DRM: code refactoring to fimd module.
    this patch is be considered with multiple display objects and
    would use its own request_irq() to register a irq handler instead of
    drm framework's one.

DRM: remove find_samsung_drm_gem_object()

DRM: move kernel private data structures and definitions to driver folder.

    samsung_drm.h would contain only public information for userspace
    ioctl interface.

DRM: code refactoring to gem modules.
    buffer module isn't dependent of gem module anymore.

DRM: fixed security issue.

DRM: remove encoder porinter from specific connector.

    samsung connector doesn't need to have generic encoder.

DRM: code clean and add exception codes.

Changelog v5:
DRM: updated fimd(display controller) driver.
    added various pixel formats, color key and pixel blending features.

DRM: removed end_buf_off from samsung_drm_overlay structure.
    this variable isn't used and end buffer address would be
    calculated by each sub driver.

DRM: use generic function for mmap_offset.
    replaced samsung_drm_gem_create_mmap_offset() and
    samsung_drm_free_mmap_offset() with generic ones applied
    to mainline recentrly.

DRM: removed unnecessary codes and added exception codes.

DRM: added comments and code clean.

Changelog v6:
DRM: added default config options.

DRM: added padding for 64-bit align.

DRM: changed prefix 'samsung' to 'exynos'

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'drm-vmware-next' into drm-core-next
Dave Airlie [Wed, 5 Oct 2011 09:18:13 +0000 (10:18 +0100)]
Merge branch 'drm-vmware-next' into drm-core-next

* drm-vmware-next: (26 commits)
  vmwgfx: Minor cleanups
  vmwgfx: Bump driver minor to advertise support for new ioctls.
  vmwgfx: Be more strict with fb depths when using screen objects
  vmwgfx: Handle device surface memory limit
  vmwgfx: Make sure we always have a user-space handle to use for objects that are backing kms framebuffers.
  vmwgfx: Optimize the command submission resource list
  vmwgfx: Fix up query processing
  vmwgfx: Allow reference and unreference of NULL fence objects.
  vmwgfx: minor dmabuf utilities cleanup
  vmwgfx: Disallow user space to send present and readback commands
  vmwgfx: Add present and readback ioctls
  vmwgfx: Place overlays in GMR area if we can
  vmwgfx: Drop 3D Legacy Display Unit support
  vmwgfx: Require HWV8 for 3d support
  vmwgfx: Add screen object support
  vmwgfx: Add dmabuf helper functions for pinning
  vmwgfx: Refactor common display unit functions to shared file
  vmwgfx: Expand the command checker to cover screen object commands
  vmwgfx: Break out dirty submission code
  vmwgfx: Break out execbuf command processing
  ...

13 years agovmwgfx: Minor cleanups
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:36 +0000 (20:13 +0200)]
vmwgfx: Minor cleanups

As suggested by Konrad Rzeszutek Wilk

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Bump driver minor to advertise support for new ioctls.
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:35 +0000 (20:13 +0200)]
vmwgfx: Bump driver minor to advertise support for new ioctls.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Be more strict with fb depths when using screen objects
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:34 +0000 (20:13 +0200)]
vmwgfx: Be more strict with fb depths when using screen objects

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Handle device surface memory limit
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:33 +0000 (20:13 +0200)]
vmwgfx: Handle device surface memory limit

Make surfaces swappable. Make sure we honor the maximum amount of surface
memory the device accepts. This is done by potentially reading back surface
contents not used by the current command submission and storing it
locally in buffer objects.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Make sure we always have a user-space handle to use for objects that are...
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:32 +0000 (20:13 +0200)]
vmwgfx: Make sure we always have a user-space handle to use for objects that are backing kms framebuffers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Optimize the command submission resource list
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:31 +0000 (20:13 +0200)]
vmwgfx: Optimize the command submission resource list

Use a list for resources referenced during command submission, instead of
an array.
As long as we don't implement parallell command submission this works fine
and simplifies things a bit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Fix up query processing
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:30 +0000 (20:13 +0200)]
vmwgfx: Fix up query processing

Previously, query results could be placed in any buffer object, but since
we didn't allow pinned buffer objects, query results could be written when
that buffer was evicted, corrupting data in other buffers.

Now, require that buffers holding query results are no more than two pages
large, and allow one single pinned such buffer. When the command submission
code encounters query result structures in other buffers, the queries in the
pinned buffer will be finished using a query barrier for the last hardware
context using the buffer. Also if the command submission code detects
that a new hardware context is used for queries, all queries of the previous
hardware context is also flushed. Currently we use waiting for a no-op
occlusion query as a query barrier for a specific context.

The query buffer is also flushed and unpinned on context destructions,
master drops and before scanout bo placement.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Allow reference and unreference of NULL fence objects.
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:29 +0000 (20:13 +0200)]
vmwgfx: Allow reference and unreference of NULL fence objects.

The execbuf utils may call reference on NULL fence objects.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: minor dmabuf utilities cleanup
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:28 +0000 (20:13 +0200)]
vmwgfx: minor dmabuf utilities cleanup

Add / fix some function comments.
Don't move out an fbdev framebuffer when unused. Just unpin.
Only have a single function that computes a SVGAGuestPtr from the buffer's
current placement, and make it more versatile by accepting a
struct ttm_buffer_object

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Disallow user space to send present and readback commands
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:27 +0000 (20:13 +0200)]
vmwgfx: Disallow user space to send present and readback commands

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Add present and readback ioctls
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:26 +0000 (20:13 +0200)]
vmwgfx: Add present and readback ioctls

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Place overlays in GMR area if we can
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:25 +0000 (20:13 +0200)]
vmwgfx: Place overlays in GMR area if we can

When we hae screen objects we are allowed to place the overlay source
in the GMR area, do this as this will save precious VRAM.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Drop 3D Legacy Display Unit support
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:24 +0000 (20:13 +0200)]
vmwgfx: Drop 3D Legacy Display Unit support

Since 3D requires HWv8 and screen objects is always available on those
hosts we only need the screen objects path for surfaces.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Require HWV8 for 3d support
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:23 +0000 (20:13 +0200)]
vmwgfx: Require HWV8 for 3d support

On lower versions, the way we mix 2D and 3D may be too slow.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Add screen object support
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:22 +0000 (20:13 +0200)]
vmwgfx: Add screen object support

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Add dmabuf helper functions for pinning
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:21 +0000 (20:13 +0200)]
vmwgfx: Add dmabuf helper functions for pinning

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Refactor common display unit functions to shared file
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:20 +0000 (20:13 +0200)]
vmwgfx: Refactor common display unit functions to shared file

More preparation for Screen Object support.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Expand the command checker to cover screen object commands
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:19 +0000 (20:13 +0200)]
vmwgfx: Expand the command checker to cover screen object commands

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Break out dirty submission code
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:18 +0000 (20:13 +0200)]
vmwgfx: Break out dirty submission code

In preperation for screen objects, still leaves the delayed workqueue
for surface updates in place.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Break out execbuf command processing
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:17 +0000 (20:13 +0200)]
vmwgfx: Break out execbuf command processing

This will make it easier to execute commands operating on user-space
resources but generated by the kernel.

JB: Added tracking if the sw_context was called from the kernel or userspace.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Some comments and BUG_ON
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:16 +0000 (20:13 +0200)]
vmwgfx: Some comments and BUG_ON

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Make sure the reserved area is at the start of vram
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:15 +0000 (20:13 +0200)]
vmwgfx: Make sure the reserved area is at the start of vram

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Add comments for buffer pinning code
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:14 +0000 (20:13 +0200)]
vmwgfx: Add comments for buffer pinning code

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Document vmw_fifo_reserve
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:13 +0000 (20:13 +0200)]
vmwgfx: Document vmw_fifo_reserve

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovmwgfx: Update register files to latest from vmware-sdk
Jakob Bornecrantz [Tue, 4 Oct 2011 18:13:12 +0000 (20:13 +0200)]
vmwgfx: Update register files to latest from vmware-sdk

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agottm: export ttm_bo_create
Thomas Hellstrom [Tue, 4 Oct 2011 18:13:11 +0000 (20:13 +0200)]
ttm: export ttm_bo_create

Used by the vmwgfx driver.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'drm-intel-fixes' into drm-intel-next
Keith Packard [Wed, 21 Sep 2011 21:52:46 +0000 (14:52 -0700)]
Merge branch 'drm-intel-fixes' into drm-intel-next

13 years agodrm/i915: Dumb down the semaphore logic
Ben Widawsky [Thu, 15 Sep 2011 03:32:47 +0000 (20:32 -0700)]
drm/i915: Dumb down the semaphore logic

While I think the previous code is correct, it was hard to follow and
hard to debug. Since we already have a ring abstraction, might as well
use it to handle the semaphore updates and compares.

I don't expect this code to make semaphores better or worse, but you
never know...

v2:
Remove magic per Keith's suggestions.
Ran Daniel's gem_ring_sync_loop test on this.

v3:
Ignored one of Keith's suggestions.

v4:
Removed some bloat per Daniel's recommendation.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
13 years agodrm/i915: pass ELD to HDMI/DP audio driver
Wu Fengguang [Mon, 5 Sep 2011 06:25:34 +0000 (14:25 +0800)]
drm/i915: pass ELD to HDMI/DP audio driver

Add ELD support for Intel Eaglelake, IbexPeak/Ironlake,
SandyBridge/CougarPoint and IvyBridge/PantherPoint chips.

ELD (EDID-Like Data) describes to the HDMI/DP audio driver the audio
capabilities of the plugged monitor. It's built and passed to audio
driver in 2 steps:

(1) at get_modes time, parse EDID and save ELD to drm_connector.eld[]

(2) at mode_set time, write drm_connector.eld[] to the Transcoder's hw
    ELD buffer and set the ELD_valid bit to inform HDMI/DP audio driver

This patch is tested OK on G45/HDMI, IbexPeak/HDMI and IvyBridge/HDMI+DP.
Test scheme: plug in the HDMI/DP monitor, and run

        cat /proc/asound/card0/eld*

to check if the monitor name, HDMI/DP type, etc. show up correctly.

Minor imperfection: the GEN5_AUD_CNTL_ST/DIP_Port_Select field always
reads 0 (reserved). Without knowing the port number, I worked it around
by setting the ELD_valid bit for ALL the three ports. It's tested to not
be a problem, because the audio driver will find invalid ELD data and
hence rightfully abort, even when it sees the ELD_valid indicator.

Thanks to Zhenyu and Pierre-Louis for a lot of valuable help and testing.

CC: Zhao Yakui <yakui.zhao@intel.com>
CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
CC: Jeremy Bush <contractfrombelow@gmail.com>
CC: Christopher White <c.white@pulseforce.com>
CC: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
CC: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
13 years agodrm: support routines for HDMI/DP ELD
Wu Fengguang [Mon, 5 Sep 2011 06:23:20 +0000 (14:23 +0800)]
drm: support routines for HDMI/DP ELD

ELD (EDID-Like Data) describes to the HDMI/DP audio driver the audio
capabilities of the plugged monitor.

This adds drm_edid_to_eld() for converting EDID to ELD. The converted
ELD will be saved in a new drm_connector.eld[128] data field. This is
necessary because the graphics driver will need to fixup some of the
data fields (eg. HDMI/DP connection type, AV sync delay) before writing
to the hardware ELD buffer. drm_av_sync_delay() will help the graphics
drivers dynamically compute the AV sync delay for fixing-up the ELD.

ELD selection policy: it's possible for one encoder to be associated
with multiple connectors (ie. monitors), in which case the first found
ELD will be returned by drm_select_eld(). This policy may not be
suitable for all users, but let's start it simple first.

The impact of ELD selection policy: assume there are two monitors, one
supports stereo playback and the other has 8-channel output; cloned
display mode is used, so that the two monitors are associated with the
same internal encoder. If only the stereo playback capability is reported,
the user won't be able to start 8-channel playback; if the 8-channel ELD
is reported, then user space applications may send 8-channel samples
down, however the user may actually be listening to the 2-channel
monitor and not connecting speakers to the 8-channel monitor.

According to James, many TVs will either refuse the display anything or
pop-up an OSD warning whenever they receive hdmi audio which they cannot
handle. Eventually we will require configurability and/or per-monitor
audio control even when the video is cloned.

CC: Zhao Yakui <yakui.zhao@intel.com>
CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
CC: Jeremy Bush <contractfrombelow@gmail.com>
CC: Christopher White <c.white@pulseforce.com>
CC: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
CC: Paul Menzel <paulepanter@users.sourceforge.net>
CC: James Cloos <cloos@jhcloos.com>
CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
13 years agodrm/i915: Enable dither whenever display bpc < frame buffer bpc
Keith Packard [Mon, 5 Sep 2011 18:53:21 +0000 (11:53 -0700)]
drm/i915: Enable dither whenever display bpc < frame buffer bpc

We want to enable dithering on any pipe where the frame buffer has
more color resolution than the output device.

The previous code was incorrectly clamping the frame buffer bpc to the
display bpc, effectively disabling dithering all of the time as the
computed frame buffer bpc would never be larger than the display bpc.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reported-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
13 years agoMerge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into...
Dave Airlie [Tue, 20 Sep 2011 08:36:22 +0000 (09:36 +0100)]
Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into drm-next

* 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux:
  Drivers: i915: Fix all space related issues.

13 years agoMerge branch 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2...
Dave Airlie [Tue, 20 Sep 2011 08:35:22 +0000 (09:35 +0100)]
Merge branch 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-next

* 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6: (353 commits)
  drm/nouveau: remove allocations from gart populate() hook
  drm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.c
  drm/nvc0/fifo: avoid touching missing subfifos
  drm/nvd9/disp: bail out of mode_set_base if no fb bound to crtc
  drm/nvd9/disp: stub some more api hooks so we don't oops on resume
  drm/nouveau: fix printk typo in ioremap failure path
  drm/nvc0/pm: minor clock readback fixes
  drm/nv40/pm: execute memory reset script from vbios
  drm/nv50/gr: refactor initialisation
  drm/nouveau: if requested, try harder at disabling sysmem pushbufs
  drm/nv50/gr: enable ctxprog xfer only when we need it to save power
  drm/nouveau/dp: add support for displayport table 0x30
  drm/nouveau/dp: return master dp table pointer too when looking up encoder
  drm/nouveau/bios: simplify U/d table hash matching func to just match
  drm/nouveau/dp: preserve non-pattern bits in DP_TRAINING_PATTERN_SET
  drm/nvc0/gr: remove MODULE_FIRMWARE() lines
  drm/nouveau/dp: use alternate lane mask for nvaf
  drm/nouveau/dp: link rate scripts are selected with a comparison table
  drm/nv40/pm: write nv40-specific reclocking routines
  drm/nv40/pm: parse geometric delta clock from vbios
  ...

13 years agodrm/nouveau: remove allocations from gart populate() hook
Ben Skeggs [Tue, 30 Aug 2011 04:30:11 +0000 (14:30 +1000)]
drm/nouveau: remove allocations from gart populate() hook

Since some somewhat questionable changes a while back, TTM provides a
completely empty array of struct dma_address that stays around for the
entire lifetime of the TTM object.

Lets use this array, *always*, rather than wasting yet more memory on
another array who's purpose is identical, as well as yet another bool array
of the same size saying *which* of the previous two arrays to use...

This change will also solve the high order allocation failures seen by
some people while using nouveau.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.c
Ben Skeggs [Fri, 26 Aug 2011 03:05:23 +0000 (13:05 +1000)]
drm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.c

I'm still not certain how to determine the number of SUBPs are present on
a given board.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/fifo: avoid touching missing subfifos
Ben Skeggs [Thu, 25 Aug 2011 05:53:57 +0000 (15:53 +1000)]
drm/nvc0/fifo: avoid touching missing subfifos

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvd9/disp: bail out of mode_set_base if no fb bound to crtc
Ben Skeggs [Thu, 25 Aug 2011 23:40:39 +0000 (09:40 +1000)]
drm/nvd9/disp: bail out of mode_set_base if no fb bound to crtc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvd9/disp: stub some more api hooks so we don't oops on resume
Ben Skeggs [Thu, 25 Aug 2011 04:09:43 +0000 (14:09 +1000)]
drm/nvd9/disp: stub some more api hooks so we don't oops on resume

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fix printk typo in ioremap failure path
Marcin Slusarz [Mon, 22 Aug 2011 21:28:56 +0000 (23:28 +0200)]
drm/nouveau: fix printk typo in ioremap failure path

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/pm: minor clock readback fixes
Ben Skeggs [Thu, 23 Jun 2011 06:37:00 +0000 (16:37 +1000)]
drm/nvc0/pm: minor clock readback fixes

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv40/pm: execute memory reset script from vbios
Ben Skeggs [Fri, 12 Aug 2011 00:05:43 +0000 (10:05 +1000)]
drm/nv40/pm: execute memory reset script from vbios

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50/gr: refactor initialisation
Ben Skeggs [Thu, 11 Aug 2011 23:30:58 +0000 (09:30 +1000)]
drm/nv50/gr: refactor initialisation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: if requested, try harder at disabling sysmem pushbufs
Ben Skeggs [Thu, 11 Aug 2011 22:56:06 +0000 (08:56 +1000)]
drm/nouveau: if requested, try harder at disabling sysmem pushbufs

On >=nv50, userspace would still end up allocating pushbufs in GART.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50/gr: enable ctxprog xfer only when we need it to save power
Martin Peres [Sat, 30 Jul 2011 21:08:45 +0000 (23:08 +0200)]
drm/nv50/gr: enable ctxprog xfer only when we need it to save power

This patch adds instructions to ctxprog and by doing, impacts context
switching performance.  My testcase showed a 1% performance cost using
glxgears that is a context-switch bound application.

Please test and report bugs/performance/power/other.

Many thanks to Maxim Levitsky for his dedicated work on lowering power
consumption with nouveau.

More patches are coming thanks to his work:

https://bugs.freedesktop.org/show_bug.cgi?id=37922

Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: add support for displayport table 0x30
Ben Skeggs [Fri, 5 Aug 2011 04:47:28 +0000 (14:47 +1000)]
drm/nouveau/dp: add support for displayport table 0x30

Written from observations of my NVD9's vbios, completely untested due to
my NVD9 lacking actual DisplayPort connectors..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: return master dp table pointer too when looking up encoder
Ben Skeggs [Fri, 5 Aug 2011 04:07:04 +0000 (14:07 +1000)]
drm/nouveau/dp: return master dp table pointer too when looking up encoder

Will need to be able to distinguish 2.0/2.1 from 3.0 soon.  Also, move
the vbios parsing to nouveau_dp where it belongs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/bios: simplify U/d table hash matching func to just match
Ben Skeggs [Fri, 5 Aug 2011 03:42:49 +0000 (13:42 +1000)]
drm/nouveau/bios: simplify U/d table hash matching func to just match

The caller is now responsible for parsing its own lists (or whatever) of
possible encoders.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: preserve non-pattern bits in DP_TRAINING_PATTERN_SET
Ben Skeggs [Fri, 5 Aug 2011 05:56:53 +0000 (15:56 +1000)]
drm/nouveau/dp: preserve non-pattern bits in DP_TRAINING_PATTERN_SET

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: remove MODULE_FIRMWARE() lines
Ben Skeggs [Sun, 7 Aug 2011 22:57:55 +0000 (08:57 +1000)]
drm/nvc0/gr: remove MODULE_FIRMWARE() lines

We don't use these by default anymore, and there's been complaints from a
number of places thinking that the firmware blobs are required still.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: use alternate lane mask for nvaf
Ben Skeggs [Fri, 5 Aug 2011 01:09:21 +0000 (11:09 +1000)]
drm/nouveau/dp: use alternate lane mask for nvaf

Naturally...  Because Macs can't just be the same as everything else
now can they?

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: link rate scripts are selected with a comparison table
Ben Skeggs [Fri, 5 Aug 2011 00:28:52 +0000 (10:28 +1000)]
drm/nouveau/dp: link rate scripts are selected with a comparison table

Not hardcoded as originally thought.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv40/pm: write nv40-specific reclocking routines
Ben Skeggs [Mon, 18 Jul 2011 05:15:34 +0000 (15:15 +1000)]
drm/nv40/pm: write nv40-specific reclocking routines

Not 100% perfect yet, but a good start towards what it'll look like in the
end.

Actually seems stable on a NV44 I have here, as much as running around OA
for a fair amount of time constantly switching between performance levels
can prove..

My NV49 isn't quite so happy, and semaphores mess up somehow (sometimes) as
a result of the memory reclocking.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv40/pm: parse geometric delta clock from vbios
Ben Skeggs [Mon, 18 Jul 2011 06:02:37 +0000 (16:02 +1000)]
drm/nv40/pm: parse geometric delta clock from vbios

This changes the meaning of what we reported as "core" clock previously.

The shader/rop units are allegedly supposed to be run at the base clock
listed in the perf table, while the geometric clock can be bumped from
this value on some boards.

So that we can report both, we'll report the base clock as "shader" (since
the shaders *do* run at it), and the geometric clock as "core".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: enable down-spread if vbios and sink support it
Ben Skeggs [Thu, 4 Aug 2011 04:31:28 +0000 (14:31 +1000)]
drm/nouveau/dp: enable down-spread if vbios and sink support it

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: execute some more vbios tables relating to link rate
Ben Skeggs [Thu, 4 Aug 2011 04:16:45 +0000 (14:16 +1000)]
drm/nouveau/dp: execute some more vbios tables relating to link rate

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: store unencoded link_bw everywhere
Ben Skeggs [Wed, 3 Aug 2011 23:55:44 +0000 (09:55 +1000)]
drm/nouveau/dp: store unencoded link_bw everywhere

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: restructure link training code
Ben Skeggs [Wed, 3 Aug 2011 23:26:44 +0000 (09:26 +1000)]
drm/nouveau/dp: restructure link training code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: pass in required datarate to link training
Ben Skeggs [Thu, 4 Aug 2011 01:04:47 +0000 (11:04 +1000)]
drm/nouveau/dp: pass in required datarate to link training

Not used currently, but it will be used in preference to pre-determined
lane/bandwidth numbers at a later point.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/bios: check for null script pointers in parser
Ben Skeggs [Thu, 4 Aug 2011 03:57:33 +0000 (13:57 +1000)]
drm/nouveau/bios: check for null script pointers in parser

Allows us to be lazy elsewhere...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nva3/backlight: add suppport for newer style backlight regs
Ben Skeggs [Tue, 2 Aug 2011 22:52:39 +0000 (08:52 +1000)]
drm/nva3/backlight: add suppport for newer style backlight regs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50/backlight: express brightness level in percent
Ben Skeggs [Tue, 2 Aug 2011 10:45:35 +0000 (20:45 +1000)]
drm/nv50/backlight: express brightness level in percent

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50/backlight: take the sor into account when bashing regs
Ben Skeggs [Tue, 2 Aug 2011 09:29:37 +0000 (19:29 +1000)]
drm/nv50/backlight: take the sor into account when bashing regs

I'm sure that out there somewhere, someone will need this.  We currently
haven't seen an example of LVDS being on a non-0 SOR so far though.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/backlight: make more consistent with rest of driver style
Ben Skeggs [Tue, 2 Aug 2011 08:54:43 +0000 (18:54 +1000)]
drm/nouveau/backlight: make more consistent with rest of driver style

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: tidy connector hotplug handler, punt messages to debug
Ben Skeggs [Tue, 2 Aug 2011 03:57:10 +0000 (13:57 +1000)]
drm/nouveau: tidy connector hotplug handler, punt messages to debug

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: remove reliance on vbios for native displayport
Ben Skeggs [Fri, 1 Jul 2011 05:51:49 +0000 (15:51 +1000)]
drm/nouveau/dp: remove reliance on vbios for native displayport

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/dp: rewrite auxch transaction routines
Ben Skeggs [Wed, 20 Jul 2011 05:50:14 +0000 (15:50 +1000)]
drm/nouveau/dp: rewrite auxch transaction routines

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: workaround semaphore hw bug causing unnecessary interrupts
Ben Skeggs [Mon, 25 Jul 2011 10:26:19 +0000 (20:26 +1000)]
drm/nouveau: workaround semaphore hw bug causing unnecessary interrupts

The HW will only accept the DMA_FROM_MEMORY class for DMA_SEMAPHORE without
asking the driver to intervene.

It appears that semaphores will work correctly even without DMA_IN_MEMORY,
so lets avoid the large amount of interrupts generated by x-chan sync.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/tmr: fix miscalculation of ratio on pre-nv4x chipsets
Ben Skeggs [Thu, 21 Jul 2011 06:12:58 +0000 (16:12 +1000)]
drm/nouveau/tmr: fix miscalculation of ratio on pre-nv4x chipsets

The clock_get() hook returns KHz, not Hz.

Also fixed to use crystal freq from dev_priv.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nva3/pm: fixup for NVAF special
Ben Skeggs [Thu, 21 Jul 2011 05:54:48 +0000 (15:54 +1000)]
drm/nva3/pm: fixup for NVAF special

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nva3/pm: use crystal freq where appropriate
Ben Skeggs [Thu, 21 Jul 2011 05:52:52 +0000 (15:52 +1000)]
drm/nva3/pm: use crystal freq where appropriate

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: determine timing crystal freq from straps
Ben Skeggs [Thu, 21 Jul 2011 05:39:06 +0000 (15:39 +1000)]
drm/nouveau: determine timing crystal freq from straps

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nva3/pm: pll disabled if bit 0 of ctrl not set
Ben Skeggs [Tue, 19 Jul 2011 23:59:05 +0000 (09:59 +1000)]
drm/nva3/pm: pll disabled if bit 0 of ctrl not set

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: magic to make auxch on new macbooks booted in EFI mode work
Ben Skeggs [Tue, 19 Jul 2011 05:59:39 +0000 (15:59 +1000)]
drm/nouveau: magic to make auxch on new macbooks booted in EFI mode work

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/pm: Document and expose CL and WR for 0x1002Cx
Roy Spliet [Thu, 14 Jul 2011 18:40:10 +0000 (20:40 +0200)]
drm/nouveau/pm: Document and expose CL and WR for 0x1002Cx

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>