Skip to content

Commit b9f5701

Browse files
committed
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
2 parents a1a9f53 + 4bc6f77 commit b9f5701

File tree

6 files changed

+58
-46
lines changed

6 files changed

+58
-46
lines changed

drivers/gpu/drm/rcar-du/rcar_lvds.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector,
8888
const struct drm_display_mode *panel_mode;
8989
struct drm_crtc_state *crtc_state;
9090

91+
if (!state->crtc)
92+
return 0;
93+
9194
if (list_empty(&connector->modes)) {
9295
dev_dbg(lvds->dev, "connector: empty modes list\n");
9396
return -EINVAL;

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,6 @@ static void vmw_master_drop(struct drm_device *dev,
12781278
dev_priv->active_master = &dev_priv->fbdev_master;
12791279
ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM);
12801280
ttm_vt_unlock(&dev_priv->fbdev_master.lock);
1281-
1282-
vmw_fb_refresh(dev_priv);
12831281
}
12841282

12851283
/**
@@ -1483,7 +1481,6 @@ static int vmw_pm_freeze(struct device *kdev)
14831481
vmw_kms_resume(dev);
14841482
if (dev_priv->enable_fb)
14851483
vmw_fb_on(dev_priv);
1486-
vmw_fb_refresh(dev_priv);
14871484
return -EBUSY;
14881485
}
14891486

@@ -1523,8 +1520,6 @@ static int vmw_pm_restore(struct device *kdev)
15231520
if (dev_priv->enable_fb)
15241521
vmw_fb_on(dev_priv);
15251522

1526-
vmw_fb_refresh(dev_priv);
1527-
15281523
return 0;
15291524
}
15301525

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv);
910910
int vmw_fb_close(struct vmw_private *dev_priv);
911911
int vmw_fb_off(struct vmw_private *vmw_priv);
912912
int vmw_fb_on(struct vmw_private *vmw_priv);
913-
void vmw_fb_refresh(struct vmw_private *vmw_priv);
914913

915914
/**
916915
* Kernel modesetting - vmwgfx_kms.c

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -866,21 +866,13 @@ int vmw_fb_on(struct vmw_private *vmw_priv)
866866
spin_lock_irqsave(&par->dirty.lock, flags);
867867
par->dirty.active = true;
868868
spin_unlock_irqrestore(&par->dirty.lock, flags);
869-
870-
return 0;
871-
}
872869

873-
/**
874-
* vmw_fb_refresh - Refresh fb display
875-
*
876-
* @vmw_priv: Pointer to device private
877-
*
878-
* Call into kms to show the fbdev display(s).
879-
*/
880-
void vmw_fb_refresh(struct vmw_private *vmw_priv)
881-
{
882-
if (!vmw_priv->fb_info)
883-
return;
870+
/*
871+
* Need to reschedule a dirty update, because otherwise that's
872+
* only done in dirty_mark() if the previous coalesced
873+
* dirty region was empty.
874+
*/
875+
schedule_delayed_work(&par->local_work, 0);
884876

885-
vmw_fb_set_par(vmw_priv->fb_info);
877+
return 0;
886878
}

drivers/gpu/drm/vmwgfx/vmwgfx_msg.c

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
329329
struct rpc_channel channel;
330330
char *msg, *reply = NULL;
331331
size_t reply_len = 0;
332-
int ret = 0;
333-
334332

335333
if (!vmw_msg_enabled)
336334
return -ENODEV;
@@ -344,15 +342,14 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
344342
return -ENOMEM;
345343
}
346344

347-
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) ||
348-
vmw_send_msg(&channel, msg) ||
349-
vmw_recv_msg(&channel, (void *) &reply, &reply_len) ||
350-
vmw_close_channel(&channel)) {
351-
DRM_ERROR("Failed to get %s", guest_info_param);
345+
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))
346+
goto out_open;
352347

353-
ret = -EINVAL;
354-
}
348+
if (vmw_send_msg(&channel, msg) ||
349+
vmw_recv_msg(&channel, (void *) &reply, &reply_len))
350+
goto out_msg;
355351

352+
vmw_close_channel(&channel);
356353
if (buffer && reply && reply_len > 0) {
357354
/* Remove reply code, which are the first 2 characters of
358355
* the reply
@@ -369,7 +366,17 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
369366
kfree(reply);
370367
kfree(msg);
371368

372-
return ret;
369+
return 0;
370+
371+
out_msg:
372+
vmw_close_channel(&channel);
373+
kfree(reply);
374+
out_open:
375+
*length = 0;
376+
kfree(msg);
377+
DRM_ERROR("Failed to get %s", guest_info_param);
378+
379+
return -EINVAL;
373380
}
374381

375382

@@ -400,15 +407,22 @@ int vmw_host_log(const char *log)
400407
return -ENOMEM;
401408
}
402409

403-
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) ||
404-
vmw_send_msg(&channel, msg) ||
405-
vmw_close_channel(&channel)) {
406-
DRM_ERROR("Failed to send log\n");
410+
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))
411+
goto out_open;
407412

408-
ret = -EINVAL;
409-
}
413+
if (vmw_send_msg(&channel, msg))
414+
goto out_msg;
410415

416+
vmw_close_channel(&channel);
411417
kfree(msg);
412418

413-
return ret;
419+
return 0;
420+
421+
out_msg:
422+
vmw_close_channel(&channel);
423+
out_open:
424+
kfree(msg);
425+
DRM_ERROR("Failed to send log\n");
426+
427+
return -EINVAL;
414428
}

drivers/gpu/drm/vmwgfx/vmwgfx_msg.h

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,24 @@
135135

136136
#else
137137

138-
/* In the 32-bit version of this macro, we use "m" because there is no
139-
* more register left for bp
138+
/*
139+
* In the 32-bit version of this macro, we store bp in a memory location
140+
* because we've ran out of registers.
141+
* Now we can't reference that memory location while we've modified
142+
* %esp or %ebp, so we first push it on the stack, just before we push
143+
* %ebp, and then when we need it we read it from the stack where we
144+
* just pushed it.
140145
*/
141146
#define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \
142147
port_num, magic, bp, \
143148
eax, ebx, ecx, edx, si, di) \
144149
({ \
145-
asm volatile ("push %%ebp;" \
146-
"mov %12, %%ebp;" \
150+
asm volatile ("push %12;" \
151+
"push %%ebp;" \
152+
"mov 0x04(%%esp), %%ebp;" \
147153
"rep outsb;" \
148-
"pop %%ebp;" : \
154+
"pop %%ebp;" \
155+
"add $0x04, %%esp;" : \
149156
"=a"(eax), \
150157
"=b"(ebx), \
151158
"=c"(ecx), \
@@ -167,10 +174,12 @@
167174
port_num, magic, bp, \
168175
eax, ebx, ecx, edx, si, di) \
169176
({ \
170-
asm volatile ("push %%ebp;" \
171-
"mov %12, %%ebp;" \
177+
asm volatile ("push %12;" \
178+
"push %%ebp;" \
179+
"mov 0x04(%%esp), %%ebp;" \
172180
"rep insb;" \
173-
"pop %%ebp" : \
181+
"pop %%ebp;" \
182+
"add $0x04, %%esp;" : \
174183
"=a"(eax), \
175184
"=b"(ebx), \
176185
"=c"(ecx), \

0 commit comments

Comments
 (0)