diff options
author | Dave Airlie <airlied@redhat.com> | 2015-08-17 16:03:48 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-08-17 16:03:48 +1000 |
commit | 294947a5c7f6d228b70fcc51a89527e74a38a2c5 (patch) | |
tree | d0f79f3978a1a129e164ce576a771e00550fb985 /drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | |
parent | 6406e45cc6f4976ace2b6d23b76bb5f07541e68f (diff) | |
parent | 54fbde8a94a8a78547597215c9e4be590d075ee0 (diff) | |
download | blackbird-op-linux-294947a5c7f6d228b70fcc51a89527e74a38a2c5.tar.gz blackbird-op-linux-294947a5c7f6d228b70fcc51a89527e74a38a2c5.zip |
Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next
A couple of fixes from the previous pull request as well as gl3 support.
There is one drm core change, an export of a previously private function.
Take 2 implementing screen targets, this time with the fbdev code adjusted
accordingly.
Also there is an implementation of register-driven command buffers, that
overrides the FIFO ring for command processing. It's needed for our upcoming
hardware revision.
* 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux: (35 commits)
drm/vmwgfx: Fix copyright headers
drm/vmwgfx: Add DX query support. Various fixes.
drm/vmwgfx: Add command parser support for a couple of DX commands
drm/vmwgfx: Command parser fixes for DX
drm/vmwgfx: Initial DX support
drm/vmwgfx: Update device includes for DX device functionality
drm: export the DRM permission check code
drm/vmwgfx: Fix crash when unloading vmwgfx v2
drm/vmwgfx: Fix framebuffer creation on older hardware
drm/vmwgfx: Fixed topology boundary checking for Screen Targets
drm/vmwgfx: Fix an uninitialized value
drm/vmwgfx: Fix compiler warning with 32-bit dma_addr_t
drm/vmwgfx: Kill a bunch of sparse warnings
drm/vmwgfx: Fix kms preferred mode sorting
drm/vmwgfx: Reinstate the legacy display system dirty callback
drm/vmwgfx: Implement fbdev on kms v2
drm/vmwgfx: Add a kernel interface to create a framebuffer v2
drm/vmwgfx: Avoid cmdbuf alloc sleeping if !TASK_RUNNING
drm/vmwgfx: Convert screen targets to new helpers v3
drm/vmwgfx: Convert screen objects to the new helpers
...
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 5c289f748ab4..bb63e4d795fa 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA + * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -57,7 +57,7 @@ struct vmw_legacy_display_unit { static void vmw_ldu_destroy(struct vmw_legacy_display_unit *ldu) { list_del_init(&ldu->active); - vmw_display_unit_cleanup(&ldu->base); + vmw_du_cleanup(&ldu->base); kfree(ldu); } @@ -279,7 +279,7 @@ static int vmw_ldu_crtc_set_config(struct drm_mode_set *set) return -EINVAL; } - vmw_fb_off(dev_priv); + vmw_svga_enable(dev_priv); crtc->primary->fb = fb; encoder->crtc = crtc; @@ -385,7 +385,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) return 0; } -int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) +int vmw_kms_ldu_init_display(struct vmw_private *dev_priv) { struct drm_device *dev = dev_priv->dev; int i, ret; @@ -422,6 +422,10 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) else vmw_ldu_init(dev_priv, 0); + dev_priv->active_display_unit = vmw_du_legacy; + + DRM_INFO("Legacy Display Unit initialized\n"); + return 0; err_vblank_cleanup: @@ -432,7 +436,7 @@ err_free: return ret; } -int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv) +int vmw_kms_ldu_close_display(struct vmw_private *dev_priv) { struct drm_device *dev = dev_priv->dev; @@ -447,3 +451,38 @@ int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv) return 0; } + + +int vmw_kms_ldu_do_dmabuf_dirty(struct vmw_private *dev_priv, + struct vmw_framebuffer *framebuffer, + unsigned flags, unsigned color, + struct drm_clip_rect *clips, + unsigned num_clips, int increment) +{ + size_t fifo_size; + int i; + + struct { + uint32_t header; + SVGAFifoCmdUpdate body; + } *cmd; + + fifo_size = sizeof(*cmd) * num_clips; + cmd = vmw_fifo_reserve(dev_priv, fifo_size); + if (unlikely(cmd == NULL)) { + DRM_ERROR("Fifo reserve failed.\n"); + return -ENOMEM; + } + + memset(cmd, 0, fifo_size); + for (i = 0; i < num_clips; i++, clips += increment) { + cmd[i].header = SVGA_CMD_UPDATE; + cmd[i].body.x = clips->x1; + cmd[i].body.y = clips->y1; + cmd[i].body.width = clips->x2 - clips->x1; + cmd[i].body.height = clips->y2 - clips->y1; + } + + vmw_fifo_commit(dev_priv, fifo_size); + return 0; +} |