Commit b9f57019 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'drm-fixes-for-v4.17-rc7' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Only two sets of drivers fixes: one rcar-du lvds regression fix, and a
  group of fixes for vmwgfx"

* tag 'drm-fixes-for-v4.17-rc7' of git://people.freedesktop.org/~airlied/linux:
  drm/vmwgfx: Schedule an fb dirty update after resume
  drm/vmwgfx: Fix host logging / guestinfo reading error paths
  drm/vmwgfx: Fix 32-bit VMW_PORT_HB_[IN|OUT] macros
  drm: rcar-du: lvds: Fix crash in .atomic_check when disabling connector
parents a1a9f537 4bc6f777
...@@ -88,6 +88,9 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector, ...@@ -88,6 +88,9 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector,
const struct drm_display_mode *panel_mode; const struct drm_display_mode *panel_mode;
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
if (!state->crtc)
return 0;
if (list_empty(&connector->modes)) { if (list_empty(&connector->modes)) {
dev_dbg(lvds->dev, "connector: empty modes list\n"); dev_dbg(lvds->dev, "connector: empty modes list\n");
return -EINVAL; return -EINVAL;
......
...@@ -1278,8 +1278,6 @@ static void vmw_master_drop(struct drm_device *dev, ...@@ -1278,8 +1278,6 @@ static void vmw_master_drop(struct drm_device *dev,
dev_priv->active_master = &dev_priv->fbdev_master; dev_priv->active_master = &dev_priv->fbdev_master;
ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM);
ttm_vt_unlock(&dev_priv->fbdev_master.lock); ttm_vt_unlock(&dev_priv->fbdev_master.lock);
vmw_fb_refresh(dev_priv);
} }
/** /**
...@@ -1483,7 +1481,6 @@ static int vmw_pm_freeze(struct device *kdev) ...@@ -1483,7 +1481,6 @@ static int vmw_pm_freeze(struct device *kdev)
vmw_kms_resume(dev); vmw_kms_resume(dev);
if (dev_priv->enable_fb) if (dev_priv->enable_fb)
vmw_fb_on(dev_priv); vmw_fb_on(dev_priv);
vmw_fb_refresh(dev_priv);
return -EBUSY; return -EBUSY;
} }
...@@ -1523,8 +1520,6 @@ static int vmw_pm_restore(struct device *kdev) ...@@ -1523,8 +1520,6 @@ static int vmw_pm_restore(struct device *kdev)
if (dev_priv->enable_fb) if (dev_priv->enable_fb)
vmw_fb_on(dev_priv); vmw_fb_on(dev_priv);
vmw_fb_refresh(dev_priv);
return 0; return 0;
} }
......
...@@ -910,7 +910,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv); ...@@ -910,7 +910,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv);
int vmw_fb_close(struct vmw_private *dev_priv); int vmw_fb_close(struct vmw_private *dev_priv);
int vmw_fb_off(struct vmw_private *vmw_priv); int vmw_fb_off(struct vmw_private *vmw_priv);
int vmw_fb_on(struct vmw_private *vmw_priv); int vmw_fb_on(struct vmw_private *vmw_priv);
void vmw_fb_refresh(struct vmw_private *vmw_priv);
/** /**
* Kernel modesetting - vmwgfx_kms.c * Kernel modesetting - vmwgfx_kms.c
......
...@@ -866,21 +866,13 @@ int vmw_fb_on(struct vmw_private *vmw_priv) ...@@ -866,21 +866,13 @@ int vmw_fb_on(struct vmw_private *vmw_priv)
spin_lock_irqsave(&par->dirty.lock, flags); spin_lock_irqsave(&par->dirty.lock, flags);
par->dirty.active = true; par->dirty.active = true;
spin_unlock_irqrestore(&par->dirty.lock, flags); spin_unlock_irqrestore(&par->dirty.lock, flags);
return 0;
}
/** /*
* vmw_fb_refresh - Refresh fb display * Need to reschedule a dirty update, because otherwise that's
* * only done in dirty_mark() if the previous coalesced
* @vmw_priv: Pointer to device private * dirty region was empty.
* */
* Call into kms to show the fbdev display(s). schedule_delayed_work(&par->local_work, 0);
*/
void vmw_fb_refresh(struct vmw_private *vmw_priv)
{
if (!vmw_priv->fb_info)
return;
vmw_fb_set_par(vmw_priv->fb_info); return 0;
} }
...@@ -329,8 +329,6 @@ int vmw_host_get_guestinfo(const char *guest_info_param, ...@@ -329,8 +329,6 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
struct rpc_channel channel; struct rpc_channel channel;
char *msg, *reply = NULL; char *msg, *reply = NULL;
size_t reply_len = 0; size_t reply_len = 0;
int ret = 0;
if (!vmw_msg_enabled) if (!vmw_msg_enabled)
return -ENODEV; return -ENODEV;
...@@ -344,15 +342,14 @@ int vmw_host_get_guestinfo(const char *guest_info_param, ...@@ -344,15 +342,14 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
return -ENOMEM; return -ENOMEM;
} }
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) || if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))
vmw_send_msg(&channel, msg) || goto out_open;
vmw_recv_msg(&channel, (void *) &reply, &reply_len) ||
vmw_close_channel(&channel)) {
DRM_ERROR("Failed to get %s", guest_info_param);
ret = -EINVAL; if (vmw_send_msg(&channel, msg) ||
} vmw_recv_msg(&channel, (void *) &reply, &reply_len))
goto out_msg;
vmw_close_channel(&channel);
if (buffer && reply && reply_len > 0) { if (buffer && reply && reply_len > 0) {
/* Remove reply code, which are the first 2 characters of /* Remove reply code, which are the first 2 characters of
* the reply * the reply
...@@ -369,7 +366,17 @@ int vmw_host_get_guestinfo(const char *guest_info_param, ...@@ -369,7 +366,17 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
kfree(reply); kfree(reply);
kfree(msg); kfree(msg);
return ret; return 0;
out_msg:
vmw_close_channel(&channel);
kfree(reply);
out_open:
*length = 0;
kfree(msg);
DRM_ERROR("Failed to get %s", guest_info_param);
return -EINVAL;
} }
...@@ -400,15 +407,22 @@ int vmw_host_log(const char *log) ...@@ -400,15 +407,22 @@ int vmw_host_log(const char *log)
return -ENOMEM; return -ENOMEM;
} }
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) || if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))
vmw_send_msg(&channel, msg) || goto out_open;
vmw_close_channel(&channel)) {
DRM_ERROR("Failed to send log\n");
ret = -EINVAL; if (vmw_send_msg(&channel, msg))
} goto out_msg;
vmw_close_channel(&channel);
kfree(msg); kfree(msg);
return ret; return 0;
out_msg:
vmw_close_channel(&channel);
out_open:
kfree(msg);
DRM_ERROR("Failed to send log\n");
return -EINVAL;
} }
...@@ -135,17 +135,24 @@ ...@@ -135,17 +135,24 @@
#else #else
/* In the 32-bit version of this macro, we use "m" because there is no /*
* more register left for bp * In the 32-bit version of this macro, we store bp in a memory location
* because we've ran out of registers.
* Now we can't reference that memory location while we've modified
* %esp or %ebp, so we first push it on the stack, just before we push
* %ebp, and then when we need it we read it from the stack where we
* just pushed it.
*/ */
#define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \ #define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \
port_num, magic, bp, \ port_num, magic, bp, \
eax, ebx, ecx, edx, si, di) \ eax, ebx, ecx, edx, si, di) \
({ \ ({ \
asm volatile ("push %%ebp;" \ asm volatile ("push %12;" \
"mov %12, %%ebp;" \ "push %%ebp;" \
"mov 0x04(%%esp), %%ebp;" \
"rep outsb;" \ "rep outsb;" \
"pop %%ebp;" : \ "pop %%ebp;" \
"add $0x04, %%esp;" : \
"=a"(eax), \ "=a"(eax), \
"=b"(ebx), \ "=b"(ebx), \
"=c"(ecx), \ "=c"(ecx), \
...@@ -167,10 +174,12 @@ ...@@ -167,10 +174,12 @@
port_num, magic, bp, \ port_num, magic, bp, \
eax, ebx, ecx, edx, si, di) \ eax, ebx, ecx, edx, si, di) \
({ \ ({ \
asm volatile ("push %%ebp;" \ asm volatile ("push %12;" \
"mov %12, %%ebp;" \ "push %%ebp;" \
"mov 0x04(%%esp), %%ebp;" \
"rep insb;" \ "rep insb;" \
"pop %%ebp" : \ "pop %%ebp;" \
"add $0x04, %%esp;" : \
"=a"(eax), \ "=a"(eax), \
"=b"(ebx), \ "=b"(ebx), \
"=c"(ecx), \ "=c"(ecx), \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment