Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-fixes-2020-06-11' of git://anongit.freedeskt…
Browse files Browse the repository at this point in the history
…op.org/drm/drm-misc into drm-next

In core, DRM connectors now notify userspace of hotplug events via
sysfs. In drivers, sun4i now uses 4 bits to store the clock's m divider;
ast sets up 24/32-bit color mode correctly.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200611075007.GA15098@linux-uq9g
  • Loading branch information
Dave Airlie committed Jun 11, 2020
2 parents addb1e2 + 291ddeb commit 66057dd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/ast/ast_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ static void ast_set_vbios_color_reg(struct ast_private *ast,
case 3:
case 4:
color_index = TrueCModeIndex;
break;
default:
return;
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/drm_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <drm/drm_print.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <drm/drm_sysfs.h>

#include <linux/uaccess.h>

Expand Down Expand Up @@ -523,6 +524,10 @@ int drm_connector_register(struct drm_connector *connector)
drm_mode_object_register(connector->dev, &connector->base);

connector->registration_state = DRM_CONNECTOR_REGISTERED;

/* Let userspace know we have a new connector */
drm_sysfs_hotplug_event(connector->dev);

goto unlock;

err_debugfs:
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/drm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ int drm_sysfs_connector_add(struct drm_connector *connector)
return PTR_ERR(connector->kdev);
}

/* Let userspace know we have a new connector */
drm_sysfs_hotplug_event(dev);

if (connector->ddc)
return sysfs_create_link(&connector->kdev->kobj,
&connector->ddc->dev.kobj, "ddc");
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sun4i/sun4i_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
#define SUN4I_HDMI_DDC_CMD_IMPLICIT_WRITE 3

#define SUN4I_HDMI_DDC_CLK_REG 0x528
#define SUN4I_HDMI_DDC_CLK_M(m) (((m) & 0x7) << 3)
#define SUN4I_HDMI_DDC_CLK_M(m) (((m) & 0xf) << 3)
#define SUN4I_HDMI_DDC_CLK_N(n) ((n) & 0x7)

#define SUN4I_HDMI_DDC_LINE_CTRL_REG 0x540
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,
unsigned long best_rate = 0;
u8 best_m = 0, best_n = 0, _m, _n;

for (_m = 0; _m < 8; _m++) {
for (_m = 0; _m < 16; _m++) {
for (_n = 0; _n < 8; _n++) {
unsigned long tmp_rate;

Expand Down

0 comments on commit 66057dd

Please sign in to comment.