Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
37cc4b9
drm/ttm: Fix dma_fence refcnt leak in ttm_bo_vm_fault_reserved
sherlly Jun 13, 2020
11425c4
drm/ttm: Fix dma_fence refcnt leak when adding move fence
sherlly Jun 13, 2020
4b3c1f1
Merge v5.8-rc1 into drm-misc-fixes
tdz Jun 16, 2020
109be8b
gpu: host1x: Clean up debugfs in error handling path
tititiou36 Apr 26, 2020
ef4e417
drm/tegra: hub: Do not enable orphaned window group
May 19, 2020
ca2030d
gpu: host1x: Register child devices
thierryreding Jun 12, 2020
a101e3d
drm/tegra: hub: Register child devices
thierryreding Jun 12, 2020
2fd2bc7
gpu: host1x: Correct trivial kernel-doc inconsistencies
cowile Jun 14, 2020
d9a0a05
gpu: host1x: Detach driver on unregister
thierryreding Apr 8, 2020
fce3a51
drm/tegra: Add zpos property for cursor planes
thierryreding Jun 10, 2020
b984b6d
drm: mcde: Fix display initialization problem
Jun 13, 2020
b48fd56
drm: mcde: Fix forgotten user of drm->dev_private
Jun 13, 2020
5f9af40
drm: rcar-du: Fix build error
May 18, 2020
efb9479
drm/panel-simple: fix connector type for LogicPD Type28 Display
aford173 Jun 15, 2020
8a4f5e1
drm/panel-simple: fix connector type for newhaven_nhd_43_480272ef_atxl
tomba Jun 9, 2020
7f757cb
video: fbdev: uvesafb: fix "noblank" option handling
bzolnier Jun 9, 2020
75b0cea
ACPI: configfs: Disallow loading ACPI tables when locked down
zx2c4 Jun 15, 2020
e6d701d
ACPI: sysfs: Fix pm_profile_attr type
nathanchance Jun 12, 2020
9486727
iommu/vt-d: Make Intel SVM code 64-bit only
LuBaolu Jun 22, 2020
16ecf10
iommu/vt-d: Set U/S bit in first level page table by default
LuBaolu Jun 22, 2020
67e8a5b
iommu/vt-d: Don't apply gfx quirks to untrusted devices
Jun 22, 2020
5031060
iommu/vt-d: Enable PCI ACS for platform opt in hint
LuBaolu Jun 22, 2020
04c0095
iommu/vt-d: Update scalable mode paging structure coherency
LuBaolu Jun 22, 2020
48f0bcf
iommu/vt-d: Fix misuse of iommu_domain_identity_map()
LuBaolu Jun 22, 2020
6c22bc1
drm: panel-orientation-quirks: Add quirk for Asus T101HA panel
jwrdegoede May 31, 2020
a05caf9
drm: panel-orientation-quirks: Use generic orientation-data for Acer …
jwrdegoede May 31, 2020
81e6737
PM: s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle
yu-chen-surf Jun 23, 2020
589bab6
cpufreq: intel_pstate: Add one more OOB control bit
spandruvada Jun 12, 2020
0659d42
PM: sleep: core: mark 2 functions as __init to save some memory
tititiou36 Jun 21, 2020
842ec61
drm/sun4i: mixer: Call of_dma_configure if there's an IOMMU
mripard May 13, 2020
ee434a4
drm/amdgpu/display: Unlock mutex on error
Jun 23, 2020
35f760b
drm/radeon: fix fb_div check in ni_init_smc_spll_table()
evdenis Jun 22, 2020
dc5bdb6
drm/fb-helper: Fix vt restore
danvet Jun 24, 2020
edfaf6f
drm/amdgpu: add fw release for sdma v5_0
wenshengsheng2020 Jun 18, 2020
5ae9c37
drm/amd/display: Enable output_bpc property on all outputs
Jun 1, 2020
fa7041d
drm/amd/display: Fix ineffective setting of max bpc property
Jun 12, 2020
b5b78a6
drm/amd: fix potential memleak in err branch
Jun 20, 2020
5107683
Merge tag 'du-fixes-20200621' of git://linuxtv.org/pinchartl/media in…
airlied Jun 25, 2020
a1cd348
Merge tag 'drm/tegra/for-5.8-rc3' of git://anongit.freedesktop.org/te…
airlied Jun 25, 2020
5b83c25
Merge tag 'amd-drm-fixes-5.8-2020-06-24' of git://people.freedesktop.…
airlied Jun 25, 2020
10e8b11
cpuidle: Rearrange s2idle-specific idle state entry code
rafaeljw Jun 25, 2020
687a0ed
Merge tag 'drm-misc-fixes-2020-06-25' of git://anongit.freedesktop.or…
airlied Jun 26, 2020
313a525
openrisc: fix boot oops when DEBUG_VM is enabled
stffrdhrn Jun 26, 2020
545b1b0
mm: do_swap_page(): fix up the error code
Jun 26, 2020
b9e20f0
mm, compaction: make capture control handling safe wrt interrupts
tehcaster Jun 26, 2020
fd7af71
kexec: do not verify the signature without the lockdown or mandatory …
lian-bo Jun 26, 2020
4cd9973
ocfs2: avoid inode removal while nfsd is accessing it
biger410 Jun 26, 2020
7569d3c
ocfs2: load global_inode_alloc
biger410 Jun 26, 2020
e5a15e1
ocfs2: fix panic on nfs server over ocfs2
biger410 Jun 26, 2020
9277f83
ocfs2: fix value of OCFS2_INVALID_SLOT
biger410 Jun 26, 2020
786ae13
lib: fix test_hmm.c reference after free
rddunlap Jun 26, 2020
d767087
mm, slab: fix sign conversion problem in memcg_uncharge_slab()
Waiman-Long Jun 26, 2020
8982ae5
mm/slab: use memzero_explicit() in kzfree()
Waiman-Long Jun 26, 2020
55860d9
slub: cure list_slab_objects() from double fix
Jun 26, 2020
243bce0
mm: fix swap cache node allocation mask
Jun 26, 2020
7f70c2a
mm/memory.c: properly pte_offset_map_lock/unlock in vm_insert_pages()
arjunroy Jun 26, 2020
9449c9c
mm/debug_vm_pgtable: fix build failure with powerpc 8xx
chleroy Jun 26, 2020
8dbdd50
make asm-generic/cacheflush.h more standalone
sfrothwell Jun 26, 2020
3c78582
media: omap3isp: remove cacheflush.h
nathanchance Jun 26, 2020
8eab703
mm/vmalloc.c: fix a warning while make xmldocs
standby24x7 Jun 26, 2020
cd324ed
mm: memcontrol: handle div0 crash race condition in memory.low
hnaz Jun 26, 2020
3a98990
mm/memcontrol.c: add missed css_put()
Jun 26, 2020
03960e3
mm/memcontrol.c: prevent missed memory.low load tears
cdown Jun 26, 2020
f9e5597
docs: mm/gup: minor documentation update
Jun 26, 2020
2a8bef3
doc: THP CoW fault no longer allocate THP
Jun 26, 2020
31d8fca
mm: workingset: age nonresident information alongside anonymous pages
hnaz Jun 26, 2020
cb68688
mm/swap: fix for "mm: workingset: age nonresident information alongsi…
JoonsooKim Jun 26, 2020
0076f02
mm/memory: fix IO cost for anonymous page
JoonsooKim Jun 26, 2020
800e26b
x86/hyperv: allocate the hypercall page with only read and execute bits
Jun 26, 2020
10d5e97
arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
Jun 26, 2020
7a0e27b
mm: remove vmalloc_exec
Jun 26, 2020
b7e3deb
mm/memory_hotplug.c: fix false softlockup during pfn range removal
Jun 26, 2020
19ef1f9
MAINTAINERS: update info for sparse
lucvoo Jun 26, 2020
0f29c20
Merge branch 'acpi-sysfs'
rafaeljw Jun 26, 2020
0e3fb2a
Merge branches 'pm-cpufreq' and 'pm-cpuidle'
rafaeljw Jun 26, 2020
7c902e2
Merge branch 'akpm' (patches from Andrew)
torvalds Jun 26, 2020
6a6c9b2
Merge tag 'drm-fixes-2020-06-26' of git://anongit.freedesktop.org/drm…
torvalds Jun 26, 2020
bd37cdf
Merge tag 'iommu-fixes-v5.8-rc2' of git://git.kernel.org/pub/scm/linu…
torvalds Jun 26, 2020
ed3e00e
Merge tag 'pm-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/g…
torvalds Jun 26, 2020
1590a2e
Merge tag 'acpi-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Jun 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Documentation/admin-guide/cgroup-v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1356,8 +1356,8 @@ PAGE_SIZE multiple when read back.

thp_fault_alloc
Number of transparent hugepages which were allocated to satisfy
a page fault, including COW faults. This counter is not present
when CONFIG_TRANSPARENT_HUGEPAGE is not set.
a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE
is not set.

thp_collapse_alloc
Number of transparent hugepages which were allocated to allow
Expand Down
3 changes: 1 addition & 2 deletions Documentation/admin-guide/mm/transhuge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ monitor how successfully the system is providing huge pages for use.

thp_fault_alloc
is incremented every time a huge page is successfully
allocated to handle a page fault. This applies to both the
first time a page is faulted and for COW faults.
allocated to handle a page fault.

thp_collapse_alloc
is incremented by khugepaged when it has found
Expand Down
2 changes: 1 addition & 1 deletion Documentation/core-api/pin_user_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ all combinations of get*(), pin*(), FOLL_LONGTERM, and more. Also, the
pin_user_pages*() APIs are clearly distinct from the get_user_pages*() APIs, so
that's a natural dividing line, and a good point to make separate wrapper calls.
In other words, use pin_user_pages*() for DMA-pinned pages, and
get_user_pages*() for other cases. There are four cases described later on in
get_user_pages*() for other cases. There are five cases described later on in
this document, to further clarify that concept.

FOLL_PIN and FOLL_GET are mutually exclusive for a given gup call. However,
Expand Down
4 changes: 3 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16058,8 +16058,10 @@ SPARSE CHECKER
M: "Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>
L: linux-sparse@vger.kernel.org
S: Maintained
W: https://sparse.wiki.kernel.org/
W: https://sparse.docs.kernel.org/
T: git git://git.kernel.org/pub/scm/devel/sparse/sparse.git
Q: https://patchwork.kernel.org/project/linux-sparse/list/
B: https://bugzilla.kernel.org/enter_bug.cgi?component=Sparse&product=Tools
F: include/linux/compiler.h

SPEAR CLOCK FRAMEWORK SUPPORT
Expand Down
12 changes: 3 additions & 9 deletions arch/arm64/kernel/probes/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)

void *alloc_insn_page(void)
{
void *page;

page = vmalloc_exec(PAGE_SIZE);
if (page) {
set_memory_ro((unsigned long)page, 1);
set_vm_flush_reset_perms(page);
}

return page;
return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
NUMA_NO_NODE, __func__);
}

/* arm kprobe: install breakpoint in text */
Expand Down
5 changes: 5 additions & 0 deletions arch/openrisc/kernel/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ void *arch_dma_set_uncached(void *cpu_addr, size_t size)
* We need to iterate through the pages, clearing the dcache for
* them and setting the cache-inhibit bit.
*/
mmap_read_lock(&init_mm);
error = walk_page_range(&init_mm, va, va + size, &set_nocache_walk_ops,
NULL);
mmap_read_unlock(&init_mm);

if (error)
return ERR_PTR(error);
return cpu_addr;
Expand All @@ -85,9 +88,11 @@ void arch_dma_clear_uncached(void *cpu_addr, size_t size)
{
unsigned long va = (unsigned long)cpu_addr;

mmap_read_lock(&init_mm);
/* walk_page_range shouldn't be able to fail here */
WARN_ON(walk_page_range(&init_mm, va, va + size,
&clear_nocache_walk_ops, NULL));
mmap_read_unlock(&init_mm);
}

void arch_sync_dma_for_device(phys_addr_t addr, size_t size,
Expand Down
4 changes: 3 additions & 1 deletion arch/x86/hyperv/hv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ void __init hyperv_init(void)
guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0);
wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);

hv_hypercall_pg = vmalloc_exec(PAGE_SIZE);
hv_hypercall_pg = __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START,
VMALLOC_END, GFP_KERNEL, PAGE_KERNEL_ROX,
VM_FLUSH_RESET_PERMS, NUMA_NO_NODE, __func__);
if (hv_hypercall_pg == NULL) {
wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
goto remove_cpuhp_state;
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/asm/pgtable_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ enum page_cache_mode {
#define _PAGE_TABLE_NOENC (__PP|__RW|_USR|___A| 0|___D| 0| 0)
#define _PAGE_TABLE (__PP|__RW|_USR|___A| 0|___D| 0| 0| _ENC)
#define __PAGE_KERNEL_RO (__PP| 0| 0|___A|__NX|___D| 0|___G)
#define __PAGE_KERNEL_ROX (__PP| 0| 0|___A| 0|___D| 0|___G)
#define __PAGE_KERNEL_NOCACHE (__PP|__RW| 0|___A|__NX|___D| 0|___G| __NC)
#define __PAGE_KERNEL_VVAR (__PP| 0|_USR|___A|__NX|___D| 0|___G)
#define __PAGE_KERNEL_LARGE (__PP|__RW| 0|___A|__NX|___D|_PSE|___G)
Expand All @@ -219,6 +220,7 @@ enum page_cache_mode {
#define PAGE_KERNEL_RO __pgprot_mask(__PAGE_KERNEL_RO | _ENC)
#define PAGE_KERNEL_EXEC __pgprot_mask(__PAGE_KERNEL_EXEC | _ENC)
#define PAGE_KERNEL_EXEC_NOENC __pgprot_mask(__PAGE_KERNEL_EXEC | 0)
#define PAGE_KERNEL_ROX __pgprot_mask(__PAGE_KERNEL_ROX | _ENC)
#define PAGE_KERNEL_NOCACHE __pgprot_mask(__PAGE_KERNEL_NOCACHE | _ENC)
#define PAGE_KERNEL_LARGE __pgprot_mask(__PAGE_KERNEL_LARGE | _ENC)
#define PAGE_KERNEL_LARGE_EXEC __pgprot_mask(__PAGE_KERNEL_LARGE_EXEC | _ENC)
Expand Down
6 changes: 5 additions & 1 deletion drivers/acpi/acpi_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/configfs.h>
#include <linux/acpi.h>
#include <linux/security.h>

#include "acpica/accommon.h"
#include "acpica/actables.h"
Expand All @@ -28,7 +29,10 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg,
{
const struct acpi_table_header *header = data;
struct acpi_table *table;
int ret;
int ret = security_locked_down(LOCKDOWN_ACPI_TABLES);

if (ret)
return ret;

table = container_of(cfg, struct acpi_table, cfg);

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,13 +938,13 @@ static void __exit interrupt_stats_exit(void)
}

static ssize_t
acpi_show_profile(struct device *dev, struct device_attribute *attr,
acpi_show_profile(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
}

static const struct device_attribute pm_profile_attr =
static const struct kobj_attribute pm_profile_attr =
__ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);

static ssize_t hotplug_enabled_show(struct kobject *kobj,
Expand Down
4 changes: 2 additions & 2 deletions drivers/base/power/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ static struct notifier_block pm_trace_nb = {
.notifier_call = pm_trace_notify,
};

static int early_resume_init(void)
static int __init early_resume_init(void)
{
hash_value_early_read = read_magic_time();
register_pm_notifier(&pm_trace_nb);
return 0;
}

static int late_resume_init(void)
static int __init late_resume_init(void)
{
unsigned int val = hash_value_early_read;
unsigned int user, file, dev;
Expand Down
7 changes: 5 additions & 2 deletions drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2677,6 +2677,8 @@ static struct acpi_platform_list plat_info[] __initdata = {
{ } /* End */
};

#define BITMASK_OOB (BIT(8) | BIT(18))

static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
{
const struct x86_cpu_id *id;
Expand All @@ -2686,8 +2688,9 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
id = x86_match_cpu(intel_pstate_cpu_oob_ids);
if (id) {
rdmsrl(MSR_MISC_PWR_MGMT, misc_pwr);
if (misc_pwr & (1 << 8)) {
pr_debug("Bit 8 in the MISC_PWR_MGMT MSR set\n");
if (misc_pwr & BITMASK_OOB) {
pr_debug("Bit 8 or 18 in the MISC_PWR_MGMT MSR set\n");
pr_debug("P states are controlled in Out of Band mode by the firmware/hardware\n");
return true;
}
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/cpuidle/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ int cpuidle_enter_s2idle(struct cpuidle_driver *drv, struct cpuidle_device *dev)
* be frozen safely.
*/
index = find_deepest_state(drv, dev, U64_MAX, 0, true);
if (index > 0)
if (index > 0) {
enter_s2idle_proper(drv, dev, index);

local_irq_enable();
}
return index;
}
#endif /* CONFIG_SUSPEND */
Expand Down
6 changes: 5 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,12 @@ static int sdma_v5_0_sw_fini(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
int i;

for (i = 0; i < adev->sdma.num_instances; i++)
for (i = 0; i < adev->sdma.num_instances; i++) {
if (adev->sdma.instance[i].fw != NULL)
release_firmware(adev->sdma.instance[i].fw);

amdgpu_ring_fini(&adev->sdma.instance[i].ring);
}

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ struct kfd_process *kfd_create_process(struct file *filep)
(int)process->lead_thread->pid);
if (ret) {
pr_warn("Creating procfs pid directory failed");
kobject_put(process->kobj);
goto out;
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5024,7 +5024,8 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
struct drm_connector *connector = &aconnector->base;
struct amdgpu_device *adev = connector->dev->dev_private;
struct dc_stream_state *stream;
int requested_bpc = connector->state ? connector->state->max_requested_bpc : 8;
const struct drm_connector_state *drm_state = dm_state ? &dm_state->base : NULL;
int requested_bpc = drm_state ? drm_state->max_requested_bpc : 8;
enum dc_status dc_result = DC_OK;

do {
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,6 @@ static const struct {
{"link_settings", &dp_link_settings_debugfs_fops},
{"phy_settings", &dp_phy_settings_debugfs_fop},
{"test_pattern", &dp_phy_test_pattern_fops},
{"output_bpc", &output_bpc_fops},
{"vrr_range", &vrr_range_fops},
#ifdef CONFIG_DRM_AMD_DC_HDCP
{"hdcp_sink_capability", &hdcp_sink_capability_fops},
Expand Down Expand Up @@ -1142,6 +1141,9 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector)
debugfs_create_file_unsafe("force_yuv420_output", 0644, dir, connector,
&force_yuv420_output_fops);

debugfs_create_file("output_bpc", 0644, dir, connector,
&output_bpc_fops);

connector->debugfs_dpcd_address = 0;
connector->debugfs_dpcd_size = 0;

Expand Down
6 changes: 4 additions & 2 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,10 @@ static ssize_t srm_data_read(struct file *filp, struct kobject *kobj, struct bin

srm = psp_get_srm(work->hdcp.config.psp.handle, &srm_version, &srm_size);

if (!srm)
return -EINVAL;
if (!srm) {
ret = -EINVAL;
goto ret;
}

if (pos >= srm_size)
ret = 0;
Expand Down
63 changes: 49 additions & 14 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,9 @@ int drm_fb_helper_debug_leave(struct fb_info *info)
}
EXPORT_SYMBOL(drm_fb_helper_debug_leave);

/**
* drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration
* @fb_helper: driver-allocated fbdev helper, can be NULL
*
* This should be called from driver's drm &drm_driver.lastclose callback
* when implementing an fbcon on top of kms using this helper. This ensures that
* the user isn't greeted with a black screen when e.g. X dies.
*
* RETURNS:
* Zero if everything went ok, negative error code otherwise.
*/
int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
static int
__drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper,
bool force)
{
bool do_delayed;
int ret;
Expand All @@ -250,7 +241,16 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
return 0;

mutex_lock(&fb_helper->lock);
ret = drm_client_modeset_commit(&fb_helper->client);
if (force) {
/*
* Yes this is the _locked version which expects the master lock
* to be held. But for forced restores we're intentionally
* racing here, see drm_fb_helper_set_par().
*/
ret = drm_client_modeset_commit_locked(&fb_helper->client);
} else {
ret = drm_client_modeset_commit(&fb_helper->client);
}

do_delayed = fb_helper->delayed_hotplug;
if (do_delayed)
Expand All @@ -262,6 +262,22 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)

return ret;
}

/**
* drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration
* @fb_helper: driver-allocated fbdev helper, can be NULL
*
* This should be called from driver's drm &drm_driver.lastclose callback
* when implementing an fbcon on top of kms using this helper. This ensures that
* the user isn't greeted with a black screen when e.g. X dies.
*
* RETURNS:
* Zero if everything went ok, negative error code otherwise.
*/
int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
{
return __drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper, false);
}
EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode_unlocked);

#ifdef CONFIG_MAGIC_SYSRQ
Expand Down Expand Up @@ -1318,6 +1334,7 @@ int drm_fb_helper_set_par(struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
struct fb_var_screeninfo *var = &info->var;
bool force;

if (oops_in_progress)
return -EBUSY;
Expand All @@ -1327,7 +1344,25 @@ int drm_fb_helper_set_par(struct fb_info *info)
return -EINVAL;
}

drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
/*
* Normally we want to make sure that a kms master takes precedence over
* fbdev, to avoid fbdev flickering and occasionally stealing the
* display status. But Xorg first sets the vt back to text mode using
* the KDSET IOCTL with KD_TEXT, and only after that drops the master
* status when exiting.
*
* In the past this was caught by drm_fb_helper_lastclose(), but on
* modern systems where logind always keeps a drm fd open to orchestrate
* the vt switching, this doesn't work.
*
* To not break the userspace ABI we have this special case here, which
* is only used for the above case. Everything else uses the normal
* commit function, which ensures that we never steal the display from
* an active drm master.
*/
force = var->activate & FB_ACTIVATE_KD_TEXT;

__drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper, force);

return 0;
}
Expand Down
14 changes: 7 additions & 7 deletions drivers/gpu/drm/drm_panel_orientation_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ struct drm_dmi_panel_orientation_data {
int orientation;
};

static const struct drm_dmi_panel_orientation_data acer_s1003 = {
.width = 800,
.height = 1280,
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
};

static const struct drm_dmi_panel_orientation_data asus_t100ha = {
.width = 800,
.height = 1280,
Expand Down Expand Up @@ -114,13 +108,19 @@ static const struct dmi_system_id orientation_data[] = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"),
},
.driver_data = (void *)&acer_s1003,
.driver_data = (void *)&lcd800x1280_rightside_up,
}, { /* Asus T100HA */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"),
},
.driver_data = (void *)&asus_t100ha,
}, { /* Asus T101HA */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"),
},
.driver_data = (void *)&lcd800x1280_rightside_up,
}, { /* GPD MicroPC (generic strings, also match on bios date) */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"),
Expand Down
Loading