The Problem: What you describe is probably either a screen connector or screen circuitry. The relationship to the OS freezing isn't likely to be coincidence. It's possible that whatever failed, related to the screen, caused a momentary short or signal that led the the OS freeze.
Possibilities: If the problem is inside the top half of your laptop (the screen), it is generally not cost effective to try to fix it. Typically, the screen is replaced.
The problem could be with the connection between the screen and the system board. Sometimes this is an actual connector and sometimes it is a ribbon cable from the screen that slips into a socket in the bottom half of the laptop. This is often repairable but it usually requires some laptop disassembly and technical proficiency (and possibly specialized tools).
Screen replacement or connection repair is not a task for novices. If you're experienced and have the tools, open it up and inspect the connection. See if it is something obvious, like the ribbon cable pulled out of the socket or a visible problem with the connector. Assess whether you can fix it. Beyond that, the fact that you asked this question is probably an indication that you don't have the training and equipment to do a diagnosis and repair or screen replacement.
Service Options: This means potentially getting it serviced. This comes down to an economic decision, which may vary with who does the work (e.g., sending it into HP authorized service vs. local shop). They may give you a flat price for screen repair, or there might be a diagnostic fee to open it up and figure out the problem, after which there would be additional costs for parts and labor to fix the problem. Check what your actual costs would be.
I did a quick online search and it looks like the entire top half of the laptop retails for around $160; the guts under the plastic shell is in the range of $110-$130. That's just for the part, not the labor. These kinds of repairs often carry a warranty of around 90 days and sometimes, the repair parts are refurbished parts, particularly if it is an older model. These are details to check on. For these reasons, major repairs are often not a great investment.
Repair vs. Replacement: I don't know which particular model you have but it looks like new 8440p laptops retail in the range of around $200-$400 depending on what's under the hood. At the low end of the range, fixing your laptop would cost as much as a new one (or more), if the screen needs replacement. At the high end, the repair would make a serious down payment on a new one. If your laptop is 4 or 5 years old, it could well be at the age where other components could start to go (like the keyboard or hard disk). All of these components can be replaced but you will end up paying the cost of a new computer to continue to own an end-of-life old one (with no warranty).
Other Options:
Continue to use it with an external monitor (zero cost).
Look at buying a new one and cannibalizing parts from the current one. You might be able to use the RAM to beef up a new one, or stick the hard drive in an external enclosure and use it as an extra drive for backup or a similar purpose. The power adapter would be a spare.
Buy a new one and save the current one as an emergency backup machine.
So that's some perspective on the choices.