Commit ec037ac2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2019-08-16' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Nothing too crazy this week, one amdgpu fix to use vmalloc for a
  struct that grew in size, and another MST fix for nouveau, and some
  other misc fixes:

  i915:
   - single GVT use after free fix

  scheduler:
   - entity destruction race fix

  amdgpu:
   - struct allocation fix
   - gfx9 soft recovery fix

  nouveau:
   - followup MST fix

  ast:
   - vga register race fix"

* tag 'drm-fixes-2019-08-16' of git://anongit.freedesktop.org/drm/drm:
  drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes
  drm/ast: Fixed reboot test may cause system hanged
  drm/scheduler: use job count instead of peek
  drm/amd/display: use kvmalloc for dc_state (v2)
  drm/amdgpu: fix gfx9 soft recovery
  drm/i915: Use after free in error path in intel_vgpu_create_workload()
parents a69e9051 a85abd5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4869,7 +4869,7 @@ static void gfx_v9_0_ring_soft_recovery(struct amdgpu_ring *ring, unsigned vmid)
	value = REG_SET_FIELD(value, SQ_CMD, MODE, 0x01);
	value = REG_SET_FIELD(value, SQ_CMD, MODE, 0x01);
	value = REG_SET_FIELD(value, SQ_CMD, CHECK_VMID, 1);
	value = REG_SET_FIELD(value, SQ_CMD, CHECK_VMID, 1);
	value = REG_SET_FIELD(value, SQ_CMD, VM_ID, vmid);
	value = REG_SET_FIELD(value, SQ_CMD, VM_ID, vmid);
	WREG32(mmSQ_CMD, value);
	WREG32_SOC15(GC, 0, mmSQ_CMD, value);
}
}


static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
+6 −5
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@
 */
 */


#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/mm.h>


#include "dm_services.h"
#include "dm_services.h"


@@ -1171,7 +1172,7 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)


struct dc_state *dc_create_state(struct dc *dc)
struct dc_state *dc_create_state(struct dc *dc)
{
{
	struct dc_state *context = kzalloc(sizeof(struct dc_state),
	struct dc_state *context = kvzalloc(sizeof(struct dc_state),
					    GFP_KERNEL);
					    GFP_KERNEL);


	if (!context)
	if (!context)
@@ -1192,11 +1193,11 @@ struct dc_state *dc_create_state(struct dc *dc)
struct dc_state *dc_copy_state(struct dc_state *src_ctx)
struct dc_state *dc_copy_state(struct dc_state *src_ctx)
{
{
	int i, j;
	int i, j;
	struct dc_state *new_ctx = kmemdup(src_ctx,
	struct dc_state *new_ctx = kvmalloc(sizeof(struct dc_state), GFP_KERNEL);
			sizeof(struct dc_state), GFP_KERNEL);


	if (!new_ctx)
	if (!new_ctx)
		return NULL;
		return NULL;
	memcpy(new_ctx, src_ctx, sizeof(struct dc_state));


	for (i = 0; i < MAX_PIPES; i++) {
	for (i = 0; i < MAX_PIPES; i++) {
			struct pipe_ctx *cur_pipe = &new_ctx->res_ctx.pipe_ctx[i];
			struct pipe_ctx *cur_pipe = &new_ctx->res_ctx.pipe_ctx[i];
@@ -1230,7 +1231,7 @@ static void dc_state_free(struct kref *kref)
{
{
	struct dc_state *context = container_of(kref, struct dc_state, refcount);
	struct dc_state *context = container_of(kref, struct dc_state, refcount);
	dc_resource_state_destruct(context);
	dc_resource_state_destruct(context);
	kfree(context);
	kvfree(context);
}
}


void dc_release_state(struct dc_state *context)
void dc_release_state(struct dc_state *context)
+4 −1
Original line number Original line Diff line number Diff line
@@ -131,8 +131,8 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)




	/* Enable extended register access */
	/* Enable extended register access */
	ast_enable_mmio(dev);
	ast_open_key(ast);
	ast_open_key(ast);
	ast_enable_mmio(dev);


	/* Find out whether P2A works or whether to use device-tree */
	/* Find out whether P2A works or whether to use device-tree */
	ast_detect_config_mode(dev, &scu_rev);
	ast_detect_config_mode(dev, &scu_rev);
@@ -576,6 +576,9 @@ void ast_driver_unload(struct drm_device *dev)
{
{
	struct ast_private *ast = dev->dev_private;
	struct ast_private *ast = dev->dev_private;


	/* enable standard VGA decode */
	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04);

	ast_release_firmware(dev);
	ast_release_firmware(dev);
	kfree(ast->dp501_fw_addr);
	kfree(ast->dp501_fw_addr);
	ast_mode_fini(dev);
	ast_mode_fini(dev);
+1 −1
Original line number Original line Diff line number Diff line
@@ -604,7 +604,7 @@ static int ast_crtc_mode_set(struct drm_crtc *crtc,
		return -EINVAL;
		return -EINVAL;
	ast_open_key(ast);
	ast_open_key(ast);


	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);


	ast_set_std_reg(crtc, adjusted_mode, &vbios_mode);
	ast_set_std_reg(crtc, adjusted_mode, &vbios_mode);
	ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode);
	ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode);
+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ void ast_enable_mmio(struct drm_device *dev)
{
{
	struct ast_private *ast = dev->dev_private;
	struct ast_private *ast = dev->dev_private;


	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
}
}




Loading