drm/exynos: add phy settings for rb modes on snow

This patch adds new phy setting for pixel clocks
71MHz,73.25MHz,88.75MHz, 115.5MHz, and 119MHz which
are used for enabling reduced blanking modes like
1680x1050 etc.

BUG=chrome-os-partner:24846
TEST=connect 1080p monitor to Snow,
verified listing of 1680x1050@119000000

Change-Id: I04343c12d60d3532b0aae64d704be70992d8b967
Signed-off-by: Shirish S <s.shirish@samsung.com>
Previous-Reviewed-on: https://chromium-review.googlesource.com/182791
(cherry picked from commit 044eed6c7462c419f77f6827d7c3d83d91bb34b1)
Reviewed-on: https://chromium-review.googlesource.com/183373
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
UPSTREAM: HID: core: add "report" hook, called once the report has been parsed

This callback is called when the parsing of the report has been done
by hid-core (so after the calls to .event). The hid drivers can now
have access to the whole report by relying on the values stored in
the different fields.

BUG=chromium:318205
TEST=None

Change-Id: Ibd4c42f595c047f433a00363c51b1a066ae665cf
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-on: https://chromium-review.googlesource.com/183261
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183990
Reviewed-by: Yufeng Shen <miletus@chromium.org>
UPSTREAM: HID: multitouch: use the callback "report" instead of sequential events

Nexio 42" devices requires to rely on the HID field Contact
Count to compute the valid values. However, this field is
most of the time at the end of the report, meaning that we
need to get the all report parsed before processing it.

This patch does not introduce functional changes.

BUG=chromium:318205
TEST=None

Change-Id: I79ee788e5e492270720d81586d2f62b75d37ac8e
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-on: https://chromium-review.googlesource.com/183262
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183991
Reviewed-by: Yufeng Shen <miletus@chromium.org>
UPSTREAM: HID: multitouch: add support for Nexio 42" panel

This device is the worst device I saw. It keeps TipSwitch and InRange
at 1 for fingers that are not touching the panel.
The solution is to rely on the field ContactCount, which is accurate
as the correct information are packed at the begining of the frame.

Unfortunately, CountactCount is most of the time at the end of the report.
The solution is to pick it when we have the whole report in raw_UGevent.

BUG=chromium:318205
TEST=None

Change-Id: I669184746edfcf5e470eaefce145d1b36c966579
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-on: https://chromium-review.googlesource.com/183263
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183992
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Support for CY-TM75 75 inch Touch Overlay

1. This device needs the same multi-touch class MT_CLS_ALWAYS_TRUE setting
as USB_DEVICE_ID_NEXIO_MULTITOUCH_420.

2. There is timeout error during initialization:
kernel: [   11.733104] hid-multitouch 0003:1870:0110.0001: usb_submit_urb(ctrl) failed: -1
kernel: [   11.734093] hid-multitouch 0003:1870:0110.0001: timeout initializing reports

Adding quirk HID_QUIRK_NO_INIT_REPORTS can solve the problem.

BUG=chromium:318205
TEST=Connect the touch overlay with ChromeOS device, and up to 6 fingers multi-touch
     work well.

Change-Id: I6029bf5d269f536618706983673ae7341b87394e
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183264
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183993
CHERRY-PICK: CHROMIUM: usb: quirks: Make DELAY_INIT wait 100ms between GetConfiguration requests

The Logitech HD Pro Webcam C920 is a very quirky device: we could
reproduce all kinds of rare enumeration failures due to broken responses
to the second (full) GetConfigurationDescriptor request. The DELAY_INIT
quirk (which delays one second after the GetDeviceDescriptor request)
helps a bit but is not perfectly reliable.

This patch adds another 100ms delay time between the first and the
second GetConfigurationDescriptor request for DELAY_INIT devices. This
seems to reliably deal with the problems we encountered on the C920, and
shouldn't have a negative impact on other devices using this quirk.

BUG=chrome-os-partner:24893
TEST=Manual
CQ-DEPEND=CL:184000

We should eventually try to push this upstream, but I'd like to wait on
how reliably it really solves the issue and what Logitech turns up in
their root-cause investigation first.

Change-Id: I69d49562fd039d460e83c96464f9ee1c8e0d55b4
Original-Change-Id: I7cd77a66c76a20b0ea3fbfd8061c155788b9bd11
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182702
Reviewed-by: Mohammed Habibulla <moch@google.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184010
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
CHERRY-PICK: CHROMIUM: usb: Add device quirk for Logitech HD Pro Webcam C920

Add device quirk for Logitech HD Pro Webcam C920. This fixes the camera
detection from cold-boot on ChromeOS.

BUG=chrome-os-partner:24893
TEST=booted multiple times and verified that Logitech HD Pro Webcam C920
is detected each time

Change-Id: I1b9b1cfb0d7784fa2770cd655cd9da08dda9137d
Original-Change-Id: I67c620b049770e1be0fb02e20e502b75486ed304
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182706
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
Reviewed-on: https://chromium-review.googlesource.com/184000
Revert "BACKPORT: drm/i915: update FBC maximum fb sizes"

This reverts commit dcf4377b17d7b8d2ab4ab708aef9c914047287c9.

It seems like the larger FBC sizes don't work at the hw level; they
cause GPU lockups and complete machine freezes. This is fairly
difficult to reproduce, so went unnoticed for a while.

Bug chromium:338588 has been filed to track solving this mystery and
reenabling FBC on link. For now, we just disable it and ship this
thing.

BUG=chromium:328929
TEST=on 8 link machines, run vimeo + webgl aquarium + youtube for 2 hours (so 16 hours of runtime total), no crash

Change-Id: I3098fd620fcb4ea0e4dc88372f7c45a6cf686563
Reviewed-on: https://chromium-review.googlesource.com/184180
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
drm: Add drm_master_relax debugfs file (non-root set/drop master ioctls)

Writing 'Y' to /sys/kernel/debug/dri/drm_master_relax allows
non-CAP_SYS_ADMIN user to call the 2 ioctls DRM_IOCTL_SET_MASTER and
DRM_IOCTL_DROP_MASTER.

This makes it possible to run 2 X11 servers at the same time, where at
least one of them runs under a non-root user (e.g. Chromium OS X server
as xorg user, and a crouton X server as root).

The behavior is not modified if /sys/kernel/debug/dri/drm_master_relax
is kept to its default value ('N').

Modifying drm_master_relax is only possible by root user, so it cannot
possibly lead to exploits. Also, even when the flag is set to 'Y',
DROP_MASTER permissions are changed to DRM_MASTER which means that only
a process that has DRM master can drop it (which is actually quite
logical), and the SET_MASTER IOCTL is changed to DRM_AUTH which allows
all authenticated DRM users to get master.

R=seanpaul@chromium.org, dbehr@chromium.org
BUG=chromium:328115
TEST=With or without the debugfs flag, WebGL examples work, and we can
     switch between VT1 and VT2.
TEST=On a peppy in developer mode: With the debugfs flag to 'Y', Ubuntu
     saucy chroot generated by crouton (xfce target) is able to start a
     second X11 display. Switching back and forth between the two
     displays works, and 3D acceleration is working in the chroot.

Change-Id: Ib8c8a1a326f6808668e319de279c05ffdbfd2837
Signed-off-by: Nicolas Boichat <nicolas@boichat.ch>
Reviewed-on: https://chromium-review.googlesource.com/183190
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: David Schneider <dnschneid@chromium.org>
Tested-by: David Schneider <dnschneid@chromium.org>
(cherry picked from commit d53b6142c2b5c742d2c547568c9814597c41ede6)
Reviewed-on: https://chromium-review.googlesource.com/184185
Reviewed-by: David Schneider <dnschneid@chromium.org>
CHERRY-PICK: BACKPORT: drm/i915: Only apply DPMS to the encoder if enabled

The current test for an attached enabled encoder fails if we have
multiple connectors aliased to the same encoder - both connectors
believe they own the enabled encoder and so we attempt to both enable
and disable DPMS on the encoder, leading to hilarity and an OOPs:

[  354.803064] WARNING: CPU: 0 PID: 482 at
/usr/src/linux/dist/3.11.2/drivers/gpu/drm/i915/intel_display.c:3869 intel_modeset_check_state+0x764/0x770 [i915]()
[  354.803064] wrong connector dpms state
[  354.803084] Modules linked in: nfsd auth_rpcgss oid_registry exportfs nfs lockd sunrpc xt_nat iptable_nat nf_nat_ipv4 nf_nat xt_limit xt_LOG xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT ipv6 xt_recent xt_conntrack nf_conntrack iptable_filter ip_tables x_tables snd_hda_codec_realtek snd_hda_codec_hdmi x86_pkg_temp_thermal snd_hda_intel coretemp kvm_intel snd_hda_codec i915 kvm snd_hwdep snd_pcm_oss snd_mixer_oss crc32_pclmul snd_pcm crc32c_intel e1000e intel_agp igb ghash_clmulni_intel intel_gtt aesni_intel cfbfillrect aes_x86_64 cfbimgblt lrw cfbcopyarea drm_kms_helper ptp video thermal processor gf128mul snd_page_alloc drm snd_timer glue_helper 8250_pci snd pps_core ablk_helper agpgart cryptd sg soundcore fan i2c_algo_bit sr_mod thermal_sys 8250 i2c_i801 serial_core
hwmon cdrom i2c_core evdev button
[  354.803086] CPU: 0 PID: 482 Comm: kworker/0:1 Not tainted 3.11.2 #1
[  354.803087] Hardware name: Supermicro X10SAE/X10SAE, BIOS 1.00 05/03/2013 [  354.803091] Workqueue: events console_callback
[  354.803092]  0000000000000009 ffff88023611db48 ffffffff814048ac ffff88023611db90
[  354.803093]  ffff88023611db80 ffffffff8103d4e3 ffff880230d82800 ffff880230f9b800
[  354.803094]  ffff880230f99000 ffff880230f99448 ffff8802351c0e00 ffff88023611dbe0
[  354.803094] Call Trace:
[  354.803098]  [<ffffffff814048ac>] dump_stack+0x54/0x8d
[  354.803101]  [<ffffffff8103d4e3>] warn_slowpath_common+0x73/0x90
[  354.803103]  [<ffffffff8103d547>] warn_slowpath_fmt+0x47/0x50
[  354.803109]  [<ffffffffa089f1be>] ? intel_ddi_connector_get_hw_state+0x5e/0x110 [i915]
[  354.803114]  [<ffffffffa0896974>] intel_modeset_check_state+0x764/0x770 [i915]
[  354.803117]  [<ffffffffa08969bb>] intel_connector_dpms+0x3b/0x60 [i915]
[  354.803120]  [<ffffffffa037e1d0>] drm_fb_helper_dpms.isra.11+0x120/0x160 [drm_kms_helper]
[  354.803122]  [<ffffffffa037e24e>] drm_fb_helper_blank+0x3e/0x80 [drm_kms_helper]
[  354.803123]  [<ffffffff812116c2>] fb_blank+0x52/0xc0
[  354.803125]  [<ffffffff8121e04b>] fbcon_blank+0x21b/0x2d0
[  354.803127]  [<ffffffff81062243>] ? update_rq_clock.part.74+0x13/0x30
[  354.803129]  [<ffffffff81047486>] ? lock_timer_base.isra.30+0x26/0x50
[  354.803130]  [<ffffffff810472b2>] ? internal_add_timer+0x12/0x40
[  354.803131]  [<ffffffff81047f48>] ? mod_timer+0xf8/0x1c0
[  354.803133]  [<ffffffff81266d61>] do_unblank_screen+0xa1/0x1c0
[  354.803134]  [<ffffffff81268087>] poke_blanked_console+0xc7/0xd0
[  354.803136]  [<ffffffff812681cf>] console_callback+0x13f/0x160
[  354.803137]  [<ffffffff81053258>] process_one_work+0x148/0x3d0
[  354.803138]  [<ffffffff81053f19>] worker_thread+0x119/0x3a0
[  354.803140]  [<ffffffff81053e00>] ? manage_workers.isra.30+0x2a0/0x2a0
[  354.803141]  [<ffffffff8105994b>] kthread+0xbb/0xc0
[  354.803142]  [<ffffffff81059890>] ? kthread_create_on_node+0x120/0x120
[  354.803144]  [<ffffffff8140b32c>] ret_from_fork+0x7c/0xb0
[  354.803145]  [<ffffffff81059890>] ? kthread_create_on_node+0x120/0x120

This regression goes back to the big modeset rework and the conversion
to the new dpms helpers which started with:

commit 5ab432ef4997ce32c9406721b37ef6e97e57dae1
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sat Jun 30 08:59:56 2012 +0200

    drm/i915/hdmi: convert to encoder->disable/enable

Original-Change-Id: I591ceee1d3d980f846fa119073587f1f62d66486
Fixes: igt/kms_flip/dpms-off-confusion
Reported-and-tested-by: Wakko Warner <wakko@animx.eu.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68030
Link:  http://lkml.kernel.org/r/20130928185023.GA21672@animx.eu.org
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
[danvet: Add regression citation, mention the igt testcase this fixes
and slap a cc: stable on the patch.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-on: https://chromium-review.googlesource.com/184222
Reviewed-by: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>

Change-Id: I6198da0df8673f91bb4b1f3f7b969237eb06984a
Reviewed-on: https://chromium-review.googlesource.com/184372
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>