The upscale and unity scale parameter for X direction pixel extension
is calculated and applied correctly only for plane 0. For other planes,
these parameters are taken from previous plane's Y direction
calculation, leading to corruption of images. Fix the calculation for
these parameters by separating the variables used for X and Y direction.
Change-Id: I066b014f2b55fc96afbf9424ebc679b409adb4c1
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Assertive display(ad) feature needs to issue screen refresh when ambient
light or backlight changes. It needs multiple screen refreshes to ensure
that AD block strength is reached. Duration between each refresh should
be vsync interval. AD calc worker is scheduled from vsync handler which
can notify the AD userspace module via sysfs node
Change-Id: If9d688de0b5befec9adab262a6ec1182b2bd5a19
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
In case of rotator buf sync ioctl, the ioctl could be called on
frame buffer device for which panel is off. However rotator sessions
may still be active. In such cases the call shouldn't fail, thus move
check for panel off only when the target sync fence timeline is for
the panel.
Change-Id: Ice4557fcbe82df2761c65f67a0bf81a2d72fde75
CRs-Fixed: 837945
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
After the commit cdc666d763b835dced549f2811561fdc86338bd4, titled
"msm: mdss: enable tearcheck after panel on for synchronization",
second control's tearcheck is never enabled due to wrong offset.
This change corrects the offset for enabling second control's tear
check block. Driver is also not disabling TE in the shutdown path,
handle the same in this change.
Change-Id: Id187705ddf49578fd2c41dba0fe9071656b17139
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Add trace points for buffer map/unamp and
msm bus scale request API calls to find
the actual latency.
Change-Id: Ic141af071f7edaa9814b4c341d7468e1d76e573b
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Based on various use-cases such as camera and flip, MDP bandwidth
limit can be changed. For debug purpose add support to change
these paramaters via debugfs. First parameter takes mode and
second paramter takes bandwidth limit for that particular mode.
E.g. echo 2 1700000 > <debugfs>/mdp/perf/threshold_bw_limit
Change-Id: I98456f4f00223136628b2d2300b5785af386b134
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
MDSS currently has fixed maximum bandwidth enabled in DT file.
But there are scenarios where this maximum bandwidth support
can change to enhance performance. Based on scenarios such as
camera use, or flip involved declare the max bandwidth for
usecase in DT and change accordingly based on usecase.
Change-Id: Icc85d75d7a60fe6f934a1fbd9d5077b620b2993d
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
When histogram is started for a logical display we store the display
number as part of histogram info structure. When histogram stop is
called on a logical display control mixers might be turned off in case
of suspend usecase which will fail histogram stop ioctl. Since driver is
caching the display number, histogram for the dspp's which are attached
to logical display can be turned off without need for checking control
mixers.
Change-Id: I4f06f5aad562ff3a3df5449166b7d174d3e800eb
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Histogram interrupts are generated when data flows through the dspp
pipes. For video mode panels if there is no commits from userspace
MDP pulls the data through the dspp pipes which will generate interrupts
at panel refresh rate. Post processing algorithms needs to be
interrupted only when there is a commit and histogram interrupt is
generated. Change clubs the histogram enable bit mask with commit to
reduce reduntant interrupts
Change-Id: I545fc26cbf9e95ad71ae2a837edc93fd3de04c68
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Adding sysfs node for backlight notification will remove the need for
userspace clients to block on a ioctl. Exposing as a sysfs node will
allow the userspace thread architecture to be optimized.
Change updates the driver to signal via sysfs node for backlight
notification
Change-Id: I00752799ac81580f7ff7ee380b39d5bf43c3f8d3
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Histogram is used by algorithms in userspace, current driver interface
is blocking ioctl call to read histogram. Moving away from blocking
ioctls in driver will reduce the userspace thread requirements.
Change adds a histogram sysfs node for each framebuffer which will be
utilized to notify the clients
Change-Id: Ia88c4d2ba3de8f96ebb5fb915be9b4cefc9471a3
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
cmd mode simulator panels depended on terminator card for HW TE
generation. This change adds the capability of SW TE, that eliminates
the requirement of terminator card. The SW/HW TE modes can be selected
by passing the override string along with the override parameters in
the panel string passed by bootloader. With this change, any panel
which has a valid device tree file file can be booted up in simulation
mode with either HW/SW TE for command mode and no TE for video mode
panels.
eg:
- simulator single DSI cmd mode with SW TE
1:dsi:0:qcom,mdss_dsi_sim_cmd:1:none#override:sim-swte
- simulator single DSI cmd mode with HW TE
1:dsi:0:qcom,mdss_dsi_sim_cmd:1:none#override:sim-hwte
- Simulator dual DSI cmd mode with SW TE
1:dsi:0:qcom,mdss_dsi_sim_cmd_0:1:qcom,mdss_dsi_sim_cmd_1
#override:sim-swte
- JDI 1080p video mode panel in simulator mode
1:dsi:0:qcom,mdss_dsi_jdi_1080p_video:1:none#override:sim
Change-Id: I4a0fdca9e22e72fe2cc2d7ad3a15e0a41a851266
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Determine if the HDCP keys are stored in software
registers or hardware fuses on supported hardware.
Change-Id: I9492a458c38aaea4303d3387d79c01bb9beb3219
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
For bandwidth calculations, driver needs to know
compression ratio factors which depends on the pixel
format. This change adds support to share this
information with user-space.
Change-Id: I08aa8792c38bb85a8114a21cbaabe905bbfee289
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
When user passed in roi is zero, skip roi validation, and make the final
roi as full screen.
Change-Id: I4062afba3f85d41cec28e1bc47ea6c0f8f61336f
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
For DSI on/off commands with command length exceeds PAGE_SIZE,
need to support multiple readings to get the complete results.
Change-Id: I372be86b8a40880a36b3dd0be5f761b2f9efb605
Signed-off-by: Yang <yangxu@codeaurora.org>
When the phone is in suspend mode, the panel turns ON and OFF
whenever it receives the message for ambient display. There
are cases whenever the Power Key is pressed, it skips the
Panel ON because already the state of the Panel is ON and the
esd_rdy didn't turn to true, which was set to false during
Panel OFF event. This result in ESD being disabled sometimes
when we coming out of ambient mode. Hence set esd_rdy to false
when panel power state state is not interactive.
Change-Id: Id8cff84dcc9b7f679221c24e25c086c3c65ebd7c
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
PWM drivers goes to bad state and cleans up the
backlight configuration on PMIC if config is called
without enable. DSI driver should enable the PWM
during continuous splash to add a refcount like
clock and regulator enable. This avoids calling
PWM APIs with invalid structures.
Change-Id: Ida72583b3e74159aaed3170e3456d21e17ea58ff
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Handoff APIs tries to do clamp configuration during
continuous splash screen. This configuration is not
working for msm8996 which put PHY in bad state for
this target. It is fixed by adding the DSI revision
check in handoff API to avoid clamp configuration.
Change-Id: I9f35d50a78f064757373711968fba05c120f3694
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
In the current implementation, too few lines while changeing frame rate
is considered as fatal and this is not true. Reduce the log level for
the same as it is a safety check before updating the dynamic refresh.
Change-Id: I0aac9d3703bdbc49536f32fa49c4307aa7231318
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Turning off pll digital block before link clocks leads
to clock status stuck ON. Ideally, DSI driver should
first stop the lanes, followed by link clock stop
and pll disable. This change implements these
recommended sequence for both DSI controllers.
Change-Id: Ibe3061a65bad2dbfdffd9505d469f10f62a6e39d
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm8996 v2 pll needs different ldo configuration in DSI
pll compared to v1 target. This changes updates the DSI
pll driver to support this new configuration.
Change-Id: Idccfad2e388273a15b45a0e8bb822513fcbbe70e
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Pll unlocked due to wrong pll fractional divider calculated.
Pll fraction divider should be reminder of 2^20 after vco
rate divided by reference clock rate.
Change-Id: I9e4c2e3c0631e533d114c3e6acf65b71b9bf00d2
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
As part of 3.18 upgrade, remove support pll support for all
other targets except msm8996.
Change-Id: Idc778ccba25ce22ad7e418c45f2bd8d21ccb95e8
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Export stereoscopic 3D modes supported by the driver to the
userspace.
Change-Id: I9992fc10abeca9cf48a9cca5efd404ec0693bb72
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
To improve the timing margin, lane mode selection
needs to be written during the HDMI PHY startup
sequence. This prevents a timing failure when
VDDCX or VCCA_CORE are applied rather than the
nominal value.
Change-Id: I2ed54f63903a473eca12fb4d8f3b542585397dae
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Update HDMI PLL calculation for thulium. These changes are based on
latest settings from PHY team.
Change-Id: I9ab20c4101ff7cbebab61c35553b3e9d4799019f
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
During split display case, pll-1 share vco output of pll-0.
Therefore pll-1's related clock dividers need to be
configured along with pll-0.
Change-Id: I98744ec0b8a5bea952f41754788ba44d824d3373
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Remove references to 14nm and replace them with thulium.
Change-Id: I8a3a86d3510bea71f19003bebe89318c2fb399d4
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Implement dsi related clocks framework so that dsi
vco pll related function be called to output correct
vco rate base on byte clock rate. After that pixel
clock rate can be achieved through MND setting.
Change-Id: I819f9fcb8afd9430f131679434c4da34641ce3f8
[veeras@codeaurora.org: As part of 3.18 upgrade,
remove all non-display related code from this commit
include/dt-bindings/clock/msm-clocks-thulium.h]
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
To completely shutdown pll 1, power down sequence has to be
called. This is different from the old sequence where disable pll
sequence acturally turn off pll.
Change-Id: Ia8b9adb8f78241e34420c0966c3c25b7684b1262
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
One subset of pll common block setting registers need to be programmed
for both pll 0 and pll 1 to prevent current leakage.
Change-Id: I1ba621f21b49e0e55c3840b281ca9323130465a2
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
This change is corresponding to the update from h/w documentation.
Change-Id: I74ac06ce0cd1b0a8b52be6fa7dab123ebb2fc79e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
The new sequence is intended to improve pll locking time. This patch
is to implement locking pll using stored codes and bypassing
calibration.
Change-Id: I1a26843b5d784984dff4fee0e17841cfc1be37cc
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
readl_poll_timeout and readl_poll_timeout_atomic really accomplish the
same thing, just in different contexts. Unify their interfaces to
reduce cognitive load on developers and code reviewers.
Change-Id: I319db7cb3894c66447b3337c6802b723a38b3544
[veeras@codeaurora.org: As part of 3.18 upgrade,
remove all non-display-related code from this commit
arch/arm/mach-msm/clock-mdss-8974.c
drivers/iommu/arm-smmu.c
include/linux/iopoll.h]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Added support for new HDMI pll present on thulium. Implemented dynamic
calculator for pll settings.
Change-Id: Ib0b728d9ffb44b753657292e387ee7b44e854122
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
The new sequence is intended to improve pll locking time. This patch
is part of new sequence in pll driver side.
Change-Id: I09760d52db12deda0c0b4bf700db301cde8a05f1
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
[imaund@codeaurora.org: Resolved context conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Parse HDMI PLL string for msm8992 to set the PLL
interface type to 20nm HDMI PLL.
Change-Id: I7fe187148395d530871dd85ccd59f0645f894096
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Add 8992 to 20nm pll supported devices.
Change-Id: Ic5ca0dc72b83da7a559cfbad1c748b25d1542919
[veeras@codeaurora.org: As part of 3.18 upgrade,
remove all non-display related code changes from the commit
include/dt-bindings/clock/msm-clocks-8992.h]
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Introduce minor delays in HDMI PHY sequence to ensure that
PHY is ready before failing with a timeout.
Change-Id: I8e9adf542b60e63c0c28d314afd5ac61fa64d1b2
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
TZ introduced a recent change which mandates the scm call
before accessing the pll registers. So, when continuous splash
is disabledin bootloader, the scm call is not made and it causes
device crash when the pll driver tries to access the registers.
This change makes it return with a disabled handoff clk from the
pll driver when continuous splash is disabled, thus not accessing
the pll registers at this point.
Change-Id: Ic487ef733f889d463d149ee347667cd8eb04084f
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Change the VCO frequency range to avoid display fading issues.
Add code to change the PLL dividers to match the new
VCO frequency range.
Change-Id: Iec62f6be26d47cdfd8b2acb895f2e80d57164833
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Automatically calculate the register
values needed for HDMI PLL based on the
pixel clock.
Change-Id: I6fbe519e0316c3f9cc12cd0afd5aa08a90deed7d
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Some of the macros in iopoll.h might be a tad verbose or
redundant. Several of the "verbose" macros are not used anywhere in the
kernel. Based on feedback from upstream, rip out the extra "wrapper"
macros and convert callers (if any) to the lower-level ones.
Also change the `_noirq' suffix to the more idiomatic `_atomic'.
The following semantic patch was used to help identify and make the
necessary changes:
@@
expression addr, val, cond, timeout_us;
@@
- readl_tight_poll_timeout(addr, val, cond, timeout_us)
+ readl_poll_timeout(addr, val, cond, 0, timeout_us)
@@
expression addr, val, cond, max_reads, time_between_us;
@@
- readl_poll_timeout_noirq(addr, val, cond, max_reads, time_between_us)
+ readl_poll_timeout_atomic(addr, val, cond, max_reads, time_between_us)
Change-Id: Ibdb054ded59d777f38f594a2f09a12c64abdb059
[veeras@codeaurora.org: As part of 3.18 upgrade, removing all
non-display related code from this commit.
arch/arm/mach-msm/clock-mdss-8974.c
drivers/clk/msm/gdsc.c
drivers/iommu/msm_iommu-v1.c
include/linux/iopoll.h]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Add changes for DSI PLL clock driver support for msm8909. Add
the compatibility string of the DSI PLL handle so that the
detection and support of DSI PLL driver for 8909 happens
dynamically.
Change-Id: If1fb96982433f90c5b82dda8686b7284825bcd09
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
Reducing delays in HDMI clock enable to prevent
the thread from being held in the realtime process
and hogging the CPU. Updated delays are provided
after further hardware testing. With the added
microsecond delay in the timout loop, C and PHY
ready should occur well before timeout.
Change-Id: Ib36a06e5309f3f8ba9e4013d08ca2ed108457beb
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Setup DSI 1 PLL clock heirarchy. This is needed for instances
where we need to turn off the second pll in case of current
leak issue.
Change-Id: I694af1fa9591b2345709687c9e7b1d69f15b56a9
[veeras@codeaurora.org: As part of 3.18 upgrade,
removing changes in include/dt-bindings/clock/msm-clocks-8994.h
from this gerrit]
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
The second DSI PLL is consuming power when it is in reset
state. Configure the needed registers to shutdown the
second DSI PLL properly even though its not been used.
Add these register configurations whenever mdss gdsc
is toggled.
Change-Id: I008bc102795ccb5991bf4b61545c2d672b453392
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>